Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Markup / TypeContext.cs / 1305600 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- _Win32.cs
- IxmlLineInfo.cs
- LineSegment.cs
- SqlBinder.cs
- RegexCompilationInfo.cs
- ToolStripRenderer.cs
- TreeNode.cs
- ResourcePermissionBase.cs
- DbConnectionPoolOptions.cs
- SupportsEventValidationAttribute.cs
- EditorPart.cs
- PixelShader.cs
- InternalReceiveMessage.cs
- ProgressiveCrcCalculatingStream.cs
- TypedReference.cs
- XmlWhitespace.cs
- keycontainerpermission.cs
- GeometryHitTestResult.cs
- DeferredElementTreeState.cs
- XmlSchemaSimpleType.cs
- ConfigurationLocation.cs
- DataGridHelper.cs
- InheritablePropertyChangeInfo.cs
- Column.cs
- Frame.cs
- TableAdapterManagerHelper.cs
- BlurEffect.cs
- XsltOutput.cs
- WebSysDisplayNameAttribute.cs
- PlainXmlSerializer.cs
- ContentPosition.cs
- TableCellCollection.cs
- EventMap.cs
- SystemFonts.cs
- DependencyObjectType.cs
- metadatamappinghashervisitor.cs
- View.cs
- UniqueEventHelper.cs
- RelatedView.cs
- WebPartEditorApplyVerb.cs
- OperatingSystem.cs
- GridViewUpdateEventArgs.cs
- GridViewColumnCollection.cs
- ValidationPropertyAttribute.cs
- ServiceKnownTypeAttribute.cs
- ProcessHost.cs
- SqlDataSourceFilteringEventArgs.cs
- DataGridTableCollection.cs
- DeobfuscatingStream.cs
- EncryptedKeyIdentifierClause.cs
- CodeLinePragma.cs
- DocumentViewerHelper.cs
- XmlSerializerNamespaces.cs
- InternalControlCollection.cs
- UInt32Converter.cs
- ParseChildrenAsPropertiesAttribute.cs
- RectangleF.cs
- PresentationAppDomainManager.cs
- HiddenFieldPageStatePersister.cs
- FrameworkContextData.cs
- XmlILConstructAnalyzer.cs
- SiteMapNode.cs
- IERequestCache.cs
- CodeGotoStatement.cs
- ResolveMatches11.cs
- FloatSumAggregationOperator.cs
- ICspAsymmetricAlgorithm.cs
- Int64Animation.cs
- DetailsViewCommandEventArgs.cs
- ListBox.cs
- UITypeEditors.cs
- PreviewPageInfo.cs
- Path.cs
- PathHelper.cs
- HtmlInputPassword.cs
- HelpKeywordAttribute.cs
- TreeNodeEventArgs.cs
- UrlPath.cs
- UDPClient.cs
- RectAnimationClockResource.cs
- SafeNativeMemoryHandle.cs
- CallbackValidator.cs
- ThreadStaticAttribute.cs
- MessageBox.cs
- FileSecurity.cs
- RawUIStateInputReport.cs
- SHA384.cs
- Ops.cs
- NavigationPropertyAccessor.cs
- SqlConnectionPoolGroupProviderInfo.cs
- InvalidOperationException.cs
- OdbcParameter.cs
- CorrelationValidator.cs
- XmlBaseWriter.cs
- AppSettingsSection.cs
- glyphs.cs
- SqlDependency.cs
- GlyphRunDrawing.cs
- FontStretchConverter.cs
- CultureInfoConverter.cs