Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Framework / System / Windows / Markup / TypeContext.cs / 1 / TypeContext.cs
//---------------------------------------------------------------------------- // // File: typeContext.cs // // Description: // class for the main TypeConverterContext object passed to type converters // // // History: // 8/02/01: rogerg Created // 05/23/03: peterost Ported to wcp // // Copyright (C) 2001 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.ComponentModel; using System.Xml; #if PBTCOMPILER namespace MS.Internal.Markup #else namespace System.Windows.Markup #endif { ///TypeConverterContext class used for parsing Attributes. internal class TypeConvertContext : ITypeDescriptorContext { #region Public #region Methods ////// OnComponentChange /// ////// member is public only because base class has /// this public member declared /// ////// void /// public void OnComponentChanged() { } ////// OnComponentChanging /// ////// member is public only because base class has /// this public member declared /// ////// void /// public bool OnComponentChanging() { return false; } ////// IServiceProvider GetService implementation /// /// /// Type of Service to be returned /// ////// member is public only because base class has /// this public member declared /// ////// Service object or null if service is not found /// virtual public object GetService(Type serviceType) { if (serviceType == typeof(IUriContext)) { return _parserContext as IUriContext; } // temporary code to optimize Paints.White etc, until this is done // in a more generic fashion in SolidPaint ctor else if (serviceType == typeof(string)) { return _attribStringValue; } #if PBTCOMPILER return null; #else // Check for the other provided services ProvideValueServiceProvider serviceProvider = _parserContext.ProvideValueProvider; return serviceProvider.GetService( serviceType ); #endif } #endregion Methods #region Properties ///Container property ////// property is public only because base class has /// this public property declared /// public IContainer Container { get {return null;} } ///Instance property ////// property is public only because base class has /// this public property declared /// public object Instance { get { return null; } } ///Propert Descriptor ////// property is public only because base class has /// this public property declared /// public PropertyDescriptor PropertyDescriptor { get { return null;} } #if !PBTCOMPILER // Make the ParserContext available internally as an optimization. public ParserContext ParserContext { get { return _parserContext; } } #endif #endregion Properties #endregion Public #region Internal #region Contructors #if !PBTCOMPILER ////// /// /// public TypeConvertContext(ParserContext parserContext) { _parserContext = parserContext; } #endif // temporary code to optimize Paints.White etc, until this is done // in a more generic fashion in SolidPaint ctor #if PBTCOMPILER ////// /// /// /// public TypeConvertContext(ParserContext parserContext, string originalAttributeValue) { _parserContext = parserContext; _attribStringValue = originalAttributeValue; } #endif #endregion Constructors #endregion internal #region Private #region Data ParserContext _parserContext; // _attribStringValue is never set when !PBTCOMPILER #pragma warning disable 0649 string _attribStringValue; #pragma warning restore 0649 #endregion Data #endregion Private } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // File: typeContext.cs // // Description: // class for the main TypeConverterContext object passed to type converters // // // History: // 8/02/01: rogerg Created // 05/23/03: peterost Ported to wcp // // Copyright (C) 2001 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.ComponentModel; using System.Xml; #if PBTCOMPILER namespace MS.Internal.Markup #else namespace System.Windows.Markup #endif { ///TypeConverterContext class used for parsing Attributes. internal class TypeConvertContext : ITypeDescriptorContext { #region Public #region Methods ////// OnComponentChange /// ////// member is public only because base class has /// this public member declared /// ////// void /// public void OnComponentChanged() { } ////// OnComponentChanging /// ////// member is public only because base class has /// this public member declared /// ////// void /// public bool OnComponentChanging() { return false; } ////// IServiceProvider GetService implementation /// /// /// Type of Service to be returned /// ////// member is public only because base class has /// this public member declared /// ////// Service object or null if service is not found /// virtual public object GetService(Type serviceType) { if (serviceType == typeof(IUriContext)) { return _parserContext as IUriContext; } // temporary code to optimize Paints.White etc, until this is done // in a more generic fashion in SolidPaint ctor else if (serviceType == typeof(string)) { return _attribStringValue; } #if PBTCOMPILER return null; #else // Check for the other provided services ProvideValueServiceProvider serviceProvider = _parserContext.ProvideValueProvider; return serviceProvider.GetService( serviceType ); #endif } #endregion Methods #region Properties ///Container property ////// property is public only because base class has /// this public property declared /// public IContainer Container { get {return null;} } ///Instance property ////// property is public only because base class has /// this public property declared /// public object Instance { get { return null; } } ///Propert Descriptor ////// property is public only because base class has /// this public property declared /// public PropertyDescriptor PropertyDescriptor { get { return null;} } #if !PBTCOMPILER // Make the ParserContext available internally as an optimization. public ParserContext ParserContext { get { return _parserContext; } } #endif #endregion Properties #endregion Public #region Internal #region Contructors #if !PBTCOMPILER ////// /// /// public TypeConvertContext(ParserContext parserContext) { _parserContext = parserContext; } #endif // temporary code to optimize Paints.White etc, until this is done // in a more generic fashion in SolidPaint ctor #if PBTCOMPILER ////// /// /// /// public TypeConvertContext(ParserContext parserContext, string originalAttributeValue) { _parserContext = parserContext; _attribStringValue = originalAttributeValue; } #endif #endregion Constructors #endregion internal #region Private #region Data ParserContext _parserContext; // _attribStringValue is never set when !PBTCOMPILER #pragma warning disable 0649 string _attribStringValue; #pragma warning restore 0649 #endregion Data #endregion Private } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RichListBox.cs
- XmlSchemaDocumentation.cs
- ScriptResourceHandler.cs
- LexicalChunk.cs
- DataGridSortCommandEventArgs.cs
- TemplateBamlTreeBuilder.cs
- CompiledIdentityConstraint.cs
- PropertyConverter.cs
- AppDomainManager.cs
- DrawingDrawingContext.cs
- Underline.cs
- FormatException.cs
- TransformProviderWrapper.cs
- ReferencedAssembly.cs
- MimeObjectFactory.cs
- QilParameter.cs
- ReadOnlyDataSource.cs
- OpCopier.cs
- CompilerState.cs
- FirstMatchCodeGroup.cs
- QfeChecker.cs
- HtmlMeta.cs
- ToolStripTemplateNode.cs
- XmlSchemaComplexContentExtension.cs
- GenericFlowSwitchHelper.cs
- MulticastNotSupportedException.cs
- DataGridViewRowCollection.cs
- ContentElementCollection.cs
- XamlSerializerUtil.cs
- QilStrConcatenator.cs
- LinqTreeNodeEvaluator.cs
- streamingZipPartStream.cs
- CommonXSendMessage.cs
- XmlElement.cs
- ToolStripOverflowButton.cs
- BinaryReader.cs
- Exceptions.cs
- ObjectQueryProvider.cs
- KeyConstraint.cs
- CompilationRelaxations.cs
- HMACSHA256.cs
- ToolTipService.cs
- TextEditorTyping.cs
- EventLogger.cs
- WindowsEditBoxRange.cs
- FixedDocumentPaginator.cs
- ExpressionConverter.cs
- CodeConstructor.cs
- XmlNodeChangedEventManager.cs
- Bookmark.cs
- ToolStripSeparator.cs
- SafeLocalMemHandle.cs
- SrgsRuleRef.cs
- WorkflowPersistenceContext.cs
- ClientScriptManager.cs
- milrender.cs
- CompoundFileIOPermission.cs
- InputReportEventArgs.cs
- CodeMemberField.cs
- GlyphElement.cs
- ContourSegment.cs
- PasswordTextContainer.cs
- OdbcInfoMessageEvent.cs
- hwndwrapper.cs
- FastEncoder.cs
- RelatedPropertyManager.cs
- XmlAttributeCollection.cs
- TypeElementCollection.cs
- FrameworkObject.cs
- ObjectDataSourceDisposingEventArgs.cs
- Char.cs
- CollectionBase.cs
- LicenseProviderAttribute.cs
- DesignerWidgets.cs
- ResolveCompletedEventArgs.cs
- ImageBrush.cs
- ComboBoxItem.cs
- ArglessEventHandlerProxy.cs
- MouseActionConverter.cs
- PrintDialogException.cs
- XmlC14NWriter.cs
- TypeContext.cs
- TemplateBuilder.cs
- Application.cs
- _emptywebproxy.cs
- MetadataSource.cs
- IUnknownConstantAttribute.cs
- Rotation3DKeyFrameCollection.cs
- wmiprovider.cs
- EntityDataSourceChangingEventArgs.cs
- SrgsToken.cs
- UpdatePanel.cs
- OperationContext.cs
- UIInitializationException.cs
- DesigntimeLicenseContextSerializer.cs
- AlphaSortedEnumConverter.cs
- _ChunkParse.cs
- QueryCacheKey.cs
- TreeIterators.cs
- SqlUtils.cs