Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- List.cs
- ScriptResourceAttribute.cs
- ToolStripLabel.cs
- HtmlInputPassword.cs
- CodeAccessSecurityEngine.cs
- Journal.cs
- Style.cs
- CommandManager.cs
- ArraySortHelper.cs
- MemberInfoSerializationHolder.cs
- Vector.cs
- AnnotationElement.cs
- DescendantOverDescendantQuery.cs
- FocusTracker.cs
- FixedPageStructure.cs
- RemotingException.cs
- KnownTypeDataContractResolver.cs
- RefreshEventArgs.cs
- DataGridViewHeaderCell.cs
- OraclePermissionAttribute.cs
- HyperLink.cs
- PreloadedPackages.cs
- URLMembershipCondition.cs
- ToolStripSplitStackLayout.cs
- ClientRuntimeConfig.cs
- CodeTypeDelegate.cs
- GridViewCellAutomationPeer.cs
- PropertyItem.cs
- Visual3DCollection.cs
- TimerEventSubscription.cs
- WindowsStatusBar.cs
- SafeTokenHandle.cs
- DesignTimeData.cs
- InstanceHandleConflictException.cs
- UserNamePasswordServiceCredential.cs
- FtpRequestCacheValidator.cs
- COM2IDispatchConverter.cs
- FolderLevelBuildProviderCollection.cs
- TrackingProfile.cs
- Utils.cs
- NonBatchDirectoryCompiler.cs
- FileDialog_Vista_Interop.cs
- SettingsAttributeDictionary.cs
- ActivationArguments.cs
- Ops.cs
- DeferredSelectedIndexReference.cs
- RequestBringIntoViewEventArgs.cs
- InvalidWMPVersionException.cs
- AdapterDictionary.cs
- AsmxEndpointPickerExtension.cs
- ErrorInfoXmlDocument.cs
- ObjectReaderCompiler.cs
- PublisherMembershipCondition.cs
- TextTreeNode.cs
- Assert.cs
- _ChunkParse.cs
- PowerModeChangedEventArgs.cs
- StringUtil.cs
- WebPartTransformerAttribute.cs
- HtmlFormParameterWriter.cs
- WebConfigurationManager.cs
- PropertyRecord.cs
- SettingsProperty.cs
- DocumentGrid.cs
- CloseCryptoHandleRequest.cs
- DeploymentSectionCache.cs
- ColumnClickEvent.cs
- EntityWithKeyStrategy.cs
- FillBehavior.cs
- TokenizerHelper.cs
- GroupDescription.cs
- SystemTcpStatistics.cs
- RepeatButtonAutomationPeer.cs
- CompModSwitches.cs
- ProfileInfo.cs
- XmlSchemaSet.cs
- MSAAEventDispatcher.cs
- ValidatingReaderNodeData.cs
- CompositeCollection.cs
- UndoEngine.cs
- EventRecord.cs
- DelayedRegex.cs
- SoapBinding.cs
- SamlEvidence.cs
- ReadContentAsBinaryHelper.cs
- CursorConverter.cs
- SiteIdentityPermission.cs
- DataViewManagerListItemTypeDescriptor.cs
- AutomationPropertyInfo.cs
- QilScopedVisitor.cs
- OleDbPropertySetGuid.cs
- DataFormats.cs
- RightsManagementSuppressedStream.cs
- EntityContainerRelationshipSetEnd.cs
- CapabilitiesSection.cs
- BindingMemberInfo.cs
- ExtractorMetadata.cs
- DataControlFieldsEditor.cs
- ThemeInfoAttribute.cs
- HierarchicalDataBoundControlAdapter.cs