Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Markup / Baml2006 / TypeConverterMarkupExtension.cs / 1305600 / TypeConverterMarkupExtension.cs
using System; using System.Collections.Generic; using System.ComponentModel; namespace System.Windows.Baml2006 { internal class TypeConverterMarkupExtension : System.Windows.Markup.MarkupExtension { private TypeConverter _converter; private object _value; public TypeConverterMarkupExtension(TypeConverter converter, object value) { _converter = converter; _value = value; } public override object ProvideValue(IServiceProvider serviceProvider) { return _converter.ConvertFrom(new TypeConverterContext(serviceProvider), System.Globalization.CultureInfo.InvariantCulture, _value); } private class TypeConverterContext : ITypeDescriptorContext { private IServiceProvider _serviceProvider; public TypeConverterContext(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; } object IServiceProvider.GetService(Type serviceType) { return _serviceProvider.GetService(serviceType); } #region ITypeDescriptorContext Methods // ITypeDescriptorContext derives from IServiceProvider. void ITypeDescriptorContext.OnComponentChanged() { } bool ITypeDescriptorContext.OnComponentChanging() { return false; } IContainer ITypeDescriptorContext.Container { get { return null; } } object ITypeDescriptorContext.Instance { get { return null; } } PropertyDescriptor ITypeDescriptorContext.PropertyDescriptor { get { return null; } } #endregion } } } // 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
- FontNamesConverter.cs
- BamlLocalizabilityResolver.cs
- QueryStatement.cs
- SmiContext.cs
- InlineObject.cs
- ObjectDisposedException.cs
- VirtualPath.cs
- HealthMonitoringSection.cs
- InkCanvasSelection.cs
- NetworkAddressChange.cs
- DynamicDataExtensions.cs
- GraphicsState.cs
- querybuilder.cs
- CharStorage.cs
- RefreshInfo.cs
- WindowAutomationPeer.cs
- SystemPens.cs
- ItemsChangedEventArgs.cs
- SpAudioStreamWrapper.cs
- TextEndOfParagraph.cs
- CacheVirtualItemsEvent.cs
- DynamicField.cs
- ISO2022Encoding.cs
- ExtendedProperty.cs
- ComboBoxRenderer.cs
- Int32Collection.cs
- EntityCommandExecutionException.cs
- SpellerInterop.cs
- Vector3dCollection.cs
- VersionValidator.cs
- XmlKeywords.cs
- ControlCachePolicy.cs
- Gdiplus.cs
- FileRecordSequenceHelper.cs
- WebControlsSection.cs
- ErrorStyle.cs
- TrustLevelCollection.cs
- CssTextWriter.cs
- TextBoxLine.cs
- BindingRestrictions.cs
- CursorInteropHelper.cs
- XPathNode.cs
- TextUtf8RawTextWriter.cs
- XmlReflectionImporter.cs
- NamespaceList.cs
- DirectoryLocalQuery.cs
- NestPullup.cs
- UInt32Converter.cs
- ToolStripPanelDesigner.cs
- LabelAutomationPeer.cs
- MimeParameters.cs
- ConnectionsZone.cs
- ConfigErrorGlyph.cs
- CompareInfo.cs
- TextElement.cs
- DeploymentExceptionMapper.cs
- BamlStream.cs
- NativeMethods.cs
- PopOutPanel.cs
- XmlDictionaryReader.cs
- FrameAutomationPeer.cs
- BitSet.cs
- WebPartDisplayModeCollection.cs
- PrinterResolution.cs
- DeferredReference.cs
- XmlDataSource.cs
- TableCellAutomationPeer.cs
- ObjectViewQueryResultData.cs
- ComponentEditorForm.cs
- TransportListener.cs
- PartitionResolver.cs
- Glyph.cs
- WebPartCloseVerb.cs
- CompositionAdorner.cs
- Misc.cs
- InkCanvasSelectionAdorner.cs
- PackageDigitalSignature.cs
- TableDesigner.cs
- PointHitTestParameters.cs
- RowToParametersTransformer.cs
- ResXResourceReader.cs
- DllHostInitializer.cs
- NullableConverter.cs
- ClientScriptManager.cs
- ServiceModelConfigurationSectionCollection.cs
- GridPatternIdentifiers.cs
- webeventbuffer.cs
- TrackingMemoryStreamFactory.cs
- RegexRunnerFactory.cs
- TextProperties.cs
- PartitionerQueryOperator.cs
- WebPartEditorCancelVerb.cs
- TableColumn.cs
- Brush.cs
- _TimerThread.cs
- ObjectItemNoOpAssemblyLoader.cs
- ExtentCqlBlock.cs
- InvokeDelegate.cs
- Misc.cs
- TextServicesCompartmentEventSink.cs