Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- CleanUpVirtualizedItemEventArgs.cs
- SynchronizedRandom.cs
- FullTextLine.cs
- TextBoxDesigner.cs
- BitmapPalettes.cs
- SpellerInterop.cs
- PagesSection.cs
- ProcessingInstructionAction.cs
- HttpResponseBase.cs
- ClrProviderManifest.cs
- QueuePropertyVariants.cs
- HtmlInputFile.cs
- Queue.cs
- MarshalByRefObject.cs
- LogicalExpr.cs
- CharacterMetrics.cs
- BuildProvider.cs
- TextTreeText.cs
- sqlstateclientmanager.cs
- TableItemProviderWrapper.cs
- RevocationPoint.cs
- ImageCodecInfo.cs
- AdornedElementPlaceholder.cs
- WebPartUserCapability.cs
- XmlIlVisitor.cs
- ToolStripButton.cs
- SafeNativeMethods.cs
- ColorBuilder.cs
- WebConfigurationFileMap.cs
- categoryentry.cs
- MultiView.cs
- UnorderedHashRepartitionStream.cs
- BinaryParser.cs
- MoveSizeWinEventHandler.cs
- AttachedPropertyInfo.cs
- LinqDataView.cs
- LocatorGroup.cs
- UnsettableComboBox.cs
- SelectingProviderEventArgs.cs
- WebConfigurationHostFileChange.cs
- ExpressionReplacer.cs
- TimelineGroup.cs
- SessionState.cs
- Transform3DGroup.cs
- SymLanguageType.cs
- KeyedCollection.cs
- Events.cs
- ChannelManager.cs
- ComponentCache.cs
- XmlFormatReaderGenerator.cs
- NetMsmqSecurityMode.cs
- SharedUtils.cs
- InternalConfigEventArgs.cs
- WebServiceData.cs
- FixedNode.cs
- AxHost.cs
- MessageContractMemberAttribute.cs
- LookupBindingPropertiesAttribute.cs
- ListViewItemSelectionChangedEvent.cs
- DataServiceClientException.cs
- Vector3DCollectionConverter.cs
- FormsAuthentication.cs
- ImageMap.cs
- SystemParameters.cs
- Label.cs
- ServiceManager.cs
- DataGridRelationshipRow.cs
- MsmqIntegrationBindingElement.cs
- MetadataResolver.cs
- ModelItemExtensions.cs
- HtmlLiteralTextAdapter.cs
- EasingKeyFrames.cs
- XsltContext.cs
- HeaderedContentControl.cs
- OperationDescription.cs
- XmlSchemaSequence.cs
- XmlRawWriterWrapper.cs
- DateTimeValueSerializer.cs
- FtpWebRequest.cs
- PointUtil.cs
- CodeTypeReference.cs
- MetadataProperty.cs
- Asn1IntegerConverter.cs
- StateManagedCollection.cs
- validation.cs
- Base64Decoder.cs
- Substitution.cs
- ModulesEntry.cs
- WebEncodingValidatorAttribute.cs
- SoapSchemaImporter.cs
- assertwrapper.cs
- SmtpTransport.cs
- CompilationLock.cs
- ParameterCollectionEditor.cs
- AsymmetricSignatureFormatter.cs
- DateTimeFormat.cs
- XPathAxisIterator.cs
- ZipFileInfo.cs
- IPipelineRuntime.cs
- UserPrincipalNameElement.cs