Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Base / System / Windows / Markup / TypeTypeConverter.cs / 1 / TypeTypeConverter.cs
/****************************************************************************\ * * File: DateTimeConverter2.cs * \***************************************************************************/ using System; using System.ComponentModel; #if PBTCOMPILER namespace MS.Internal.Markup #else namespace System.Windows.Markup #endif { ////// TypeConverter for System.Type /// internal class TypeTypeConverter : TypeConverter { #if !PBTCOMPILER public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { return sourceType == typeof(string); } public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { string typeName = value as string; if (null != context && typeName != null) { IXamlTypeResolver xamlTypeResolver = (IXamlTypeResolver)context.GetService(typeof(IXamlTypeResolver)); if (null != xamlTypeResolver) { return xamlTypeResolver.Resolve(typeName); } } return base.ConvertFrom(context, culture, value); } #endif } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. /****************************************************************************\ * * File: DateTimeConverter2.cs * \***************************************************************************/ using System; using System.ComponentModel; #if PBTCOMPILER namespace MS.Internal.Markup #else namespace System.Windows.Markup #endif { ////// TypeConverter for System.Type /// internal class TypeTypeConverter : TypeConverter { #if !PBTCOMPILER public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { return sourceType == typeof(string); } public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { string typeName = value as string; if (null != context && typeName != null) { IXamlTypeResolver xamlTypeResolver = (IXamlTypeResolver)context.GetService(typeof(IXamlTypeResolver)); if (null != xamlTypeResolver) { return xamlTypeResolver.Resolve(typeName); } } return base.ConvertFrom(context, culture, value); } #endif } } // 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
- FrameworkContentElement.cs
- ModulesEntry.cs
- Dictionary.cs
- Environment.cs
- ScaleTransform3D.cs
- MediaElementAutomationPeer.cs
- SQLMoneyStorage.cs
- EdmFunctions.cs
- TransformValueSerializer.cs
- XmlAttributes.cs
- RequestTimeoutManager.cs
- AssemblyName.cs
- Rect3D.cs
- SortFieldComparer.cs
- LocationUpdates.cs
- EntitySetBaseCollection.cs
- BamlLocalizer.cs
- SqlFunctionAttribute.cs
- DataGridViewCellPaintingEventArgs.cs
- PartialCachingAttribute.cs
- ElementNotAvailableException.cs
- RowSpanVector.cs
- StrokeNodeOperations2.cs
- SystemNetworkInterface.cs
- serverconfig.cs
- ColorBlend.cs
- StylusButtonCollection.cs
- IERequestCache.cs
- EventLogPermissionEntryCollection.cs
- EncodingTable.cs
- OrderingInfo.cs
- figurelengthconverter.cs
- TrustSection.cs
- PersistChildrenAttribute.cs
- HtmlToClrEventProxy.cs
- AstNode.cs
- Rect3D.cs
- TextContainer.cs
- IntegerValidatorAttribute.cs
- SessionPageStateSection.cs
- _AutoWebProxyScriptEngine.cs
- ResourceSetExpression.cs
- ImportContext.cs
- BaseHashHelper.cs
- Parser.cs
- Timeline.cs
- SweepDirectionValidation.cs
- XmlSchemaIdentityConstraint.cs
- CmsUtils.cs
- ConditionalAttribute.cs
- _UriTypeConverter.cs
- XpsViewerException.cs
- Dictionary.cs
- XmlSchemaAttributeGroup.cs
- BasicExpandProvider.cs
- complextypematerializer.cs
- CloudCollection.cs
- DropSource.cs
- TableRowCollection.cs
- ImageUrlEditor.cs
- UDPClient.cs
- PropertyConverter.cs
- Debugger.cs
- MatrixStack.cs
- RectangleConverter.cs
- SQLByteStorage.cs
- ArrayConverter.cs
- Vector.cs
- Latin1Encoding.cs
- SafeSystemMetrics.cs
- COM2ExtendedUITypeEditor.cs
- XmlMemberMapping.cs
- EventListenerClientSide.cs
- ControlCollection.cs
- DelayDesigner.cs
- DataGridViewRowsRemovedEventArgs.cs
- mediaclock.cs
- RepeatButtonAutomationPeer.cs
- IPCCacheManager.cs
- VirtualPathProvider.cs
- StoreUtilities.cs
- TextElementCollectionHelper.cs
- MouseGesture.cs
- BindingOperations.cs
- Converter.cs
- InternalException.cs
- TextLine.cs
- Debug.cs
- AmbientValueAttribute.cs
- SHA512Managed.cs
- CaseExpr.cs
- CustomLineCap.cs
- TagNameToTypeMapper.cs
- RequestCacheManager.cs
- DataGridViewComboBoxCell.cs
- TimeSpanConverter.cs
- AsymmetricCryptoHandle.cs
- SmtpFailedRecipientsException.cs
- ConfigPathUtility.cs
- HttpModulesInstallComponent.cs