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
- SecurityTokenException.cs
- RIPEMD160Managed.cs
- TextServicesProperty.cs
- DelegateBodyWriter.cs
- DynamicDataExtensions.cs
- Missing.cs
- _CookieModule.cs
- SmiConnection.cs
- RadioButton.cs
- FlowDocumentFormatter.cs
- ConfigsHelper.cs
- SrgsElementFactory.cs
- BrushValueSerializer.cs
- CompositionCommandSet.cs
- DelegateHelpers.cs
- RankException.cs
- BaseServiceProvider.cs
- IdleTimeoutMonitor.cs
- Geometry3D.cs
- KeyMatchBuilder.cs
- SafeReversePInvokeHandle.cs
- NetWebProxyFinder.cs
- ObjectKeyFrameCollection.cs
- XmlNamespaceMappingCollection.cs
- ProcessHostFactoryHelper.cs
- QuotedPrintableStream.cs
- ExpressionParser.cs
- CodeAttachEventStatement.cs
- AutomationPropertyInfo.cs
- XmlConverter.cs
- DocumentPageView.cs
- CompositeDataBoundControl.cs
- TCPClient.cs
- ToolStripComboBox.cs
- Trigger.cs
- InheritablePropertyChangeInfo.cs
- HttpHeaderCollection.cs
- DataGridViewCellStyleConverter.cs
- HitTestParameters.cs
- SqlSelectStatement.cs
- TypeDescriptionProvider.cs
- ChtmlPhoneCallAdapter.cs
- XPathAxisIterator.cs
- ListItemConverter.cs
- DBConcurrencyException.cs
- AuthenticateEventArgs.cs
- EventOpcode.cs
- EnumMember.cs
- HierarchicalDataSourceConverter.cs
- ObjectConverter.cs
- PeerNameResolver.cs
- TextEditorTables.cs
- RelatedView.cs
- DocumentViewerBaseAutomationPeer.cs
- IISUnsafeMethods.cs
- ListViewItemEventArgs.cs
- glyphs.cs
- EntityContainerAssociationSet.cs
- FontDifferentiator.cs
- MimePart.cs
- SharedStatics.cs
- CertificateReferenceElement.cs
- FormViewAutoFormat.cs
- Parallel.cs
- MessageDecoder.cs
- ToolStripSeparator.cs
- EntityDataSourceState.cs
- CustomError.cs
- PreDigestedSignedInfo.cs
- codemethodreferenceexpression.cs
- XPathEmptyIterator.cs
- Environment.cs
- DataRecordInfo.cs
- SpnegoTokenAuthenticator.cs
- ListenerSingletonConnectionReader.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- XmlTextReader.cs
- GridViewDeletedEventArgs.cs
- StylusCollection.cs
- CommandBindingCollection.cs
- StorageRoot.cs
- AbsoluteQuery.cs
- CombinedGeometry.cs
- ContentPathSegment.cs
- OdbcCommandBuilder.cs
- StringUtil.cs
- RelationshipConstraintValidator.cs
- IsolatedStoragePermission.cs
- MobileRedirect.cs
- InkCanvas.cs
- BCLDebug.cs
- WindowClosedEventArgs.cs
- DebugView.cs
- FreezableDefaultValueFactory.cs
- ParameterCollectionEditorForm.cs
- DictionaryEntry.cs
- TypeDelegator.cs
- PointCollectionConverter.cs
- SimpleBitVector32.cs
- ExpressionNode.cs