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
- EFTableProvider.cs
- MessagePropertyVariants.cs
- SelectionProviderWrapper.cs
- XmlSchemaElement.cs
- Animatable.cs
- DodSequenceMerge.cs
- AccessorTable.cs
- ConnectionConsumerAttribute.cs
- FormatSettings.cs
- ToolStripItemTextRenderEventArgs.cs
- CompressionTransform.cs
- BufferedGraphics.cs
- IndexerNameAttribute.cs
- CodeMemberEvent.cs
- IpcServerChannel.cs
- OleCmdHelper.cs
- ConfigXmlCDataSection.cs
- Regex.cs
- FacetEnabledSchemaElement.cs
- Span.cs
- BaseDataListPage.cs
- SqlDeflator.cs
- ObjectCloneHelper.cs
- FontDriver.cs
- AnimationLayer.cs
- DeploymentSection.cs
- ColumnMapTranslator.cs
- ClientTargetCollection.cs
- AssociationTypeEmitter.cs
- ImageConverter.cs
- ScrollItemPattern.cs
- XamlToRtfWriter.cs
- ApplicationContext.cs
- PageStatePersister.cs
- DataGridTextBoxColumn.cs
- XmlSchemaParticle.cs
- XmlSchemaAttribute.cs
- BuildProvidersCompiler.cs
- HttpModulesSection.cs
- ClientScriptManager.cs
- mactripleDES.cs
- Model3DCollection.cs
- MustUnderstandBehavior.cs
- FieldToken.cs
- DataGridViewHitTestInfo.cs
- DataServiceHost.cs
- XmlWhitespace.cs
- XmlSchemaAttribute.cs
- StrokeCollection2.cs
- DispatcherHookEventArgs.cs
- Package.cs
- GridViewRow.cs
- SimpleBitVector32.cs
- DbCommandTree.cs
- MasterPageBuildProvider.cs
- Bits.cs
- ClosableStream.cs
- EmptyControlCollection.cs
- UnsafeNativeMethodsCLR.cs
- ArrayHelper.cs
- SizeLimitedCache.cs
- InstanceOwner.cs
- Context.cs
- ResXResourceSet.cs
- Tile.cs
- COM2IProvidePropertyBuilderHandler.cs
- CodeObject.cs
- ResourceAssociationSetEnd.cs
- PagerSettings.cs
- SqlRowUpdatedEvent.cs
- TextTreeText.cs
- CheckBoxStandardAdapter.cs
- CalculatedColumn.cs
- RowToParametersTransformer.cs
- TdsRecordBufferSetter.cs
- Calendar.cs
- XamlStream.cs
- SamlSecurityTokenAuthenticator.cs
- CryptoApi.cs
- SizeChangedEventArgs.cs
- BinaryWriter.cs
- NamespaceExpr.cs
- StorageMappingItemLoader.cs
- TypeHelpers.cs
- ConfigurationStrings.cs
- Directory.cs
- HtmlElementCollection.cs
- TypedReference.cs
- KeyValuePair.cs
- XhtmlTextWriter.cs
- AlignmentXValidation.cs
- FormsIdentity.cs
- TextRunTypographyProperties.cs
- CodeMethodReturnStatement.cs
- PointF.cs
- StylusPointCollection.cs
- PropertyChangedEventManager.cs
- PerformanceCounter.cs
- NonBatchDirectoryCompiler.cs
- GridViewUpdateEventArgs.cs