Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / XNameConverter.cs / 1305376 / XNameConverter.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.Activities.Presentation { using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Xml.Linq; [SuppressMessage("XAML", "XAML1004", Justification = "We want to keep this for internal use by the WorkflowDesigner assemblies.")] sealed class XNameConverter : TypeConverter { public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { return typeof(string) == sourceType; } public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { string currentValue = (string)value; XName result = null; if (null != currentValue) { result = currentValue; } return result; } public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { return typeof(string) == destinationType; } public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { XName currentValue = (XName)value; string result = null; if (null != currentValue) { result = currentValue.ToString(); } return result; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.Activities.Presentation { using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Xml.Linq; [SuppressMessage("XAML", "XAML1004", Justification = "We want to keep this for internal use by the WorkflowDesigner assemblies.")] sealed class XNameConverter : TypeConverter { public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { return typeof(string) == sourceType; } public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { string currentValue = (string)value; XName result = null; if (null != currentValue) { result = currentValue; } return result; } public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { return typeof(string) == destinationType; } public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { XName currentValue = (XName)value; string result = null; if (null != currentValue) { result = currentValue.ToString(); } return result; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AccessViolationException.cs
- Transform.cs
- MimeMapping.cs
- SwitchLevelAttribute.cs
- CompiledXpathExpr.cs
- XmlUtil.cs
- SerializationAttributes.cs
- XPathSelectionIterator.cs
- StatusBarPanel.cs
- Message.cs
- UnmanagedHandle.cs
- DefaultSerializationProviderAttribute.cs
- Graphics.cs
- ConfigurationConverterBase.cs
- MonitoringDescriptionAttribute.cs
- DES.cs
- SafeNativeMethods.cs
- DecoderExceptionFallback.cs
- SizeAnimation.cs
- WebPartManager.cs
- Run.cs
- WindowsGraphics2.cs
- MailBnfHelper.cs
- NativeObjectSecurity.cs
- KeysConverter.cs
- DesignerWebPartChrome.cs
- ThreadAbortException.cs
- ControlCollection.cs
- AssociationSetMetadata.cs
- Debug.cs
- _OSSOCK.cs
- ByteStorage.cs
- DataReaderContainer.cs
- RtfControls.cs
- CharEnumerator.cs
- IfElseDesigner.xaml.cs
- BookmarkResumptionRecord.cs
- Win32.cs
- StatusBarItem.cs
- OptimizerPatterns.cs
- AcceleratedTokenProviderState.cs
- PageAsyncTask.cs
- TypeElementCollection.cs
- ProcessHost.cs
- SHA512Managed.cs
- WindowsToolbarAsMenu.cs
- TargetPerspective.cs
- AssociationSet.cs
- SchemaManager.cs
- SqlGenerator.cs
- RangeValuePatternIdentifiers.cs
- DirectoryNotFoundException.cs
- HTTP_SERVICE_CONFIG_URLACL_PARAM.cs
- StatusBar.cs
- TransformerConfigurationWizardBase.cs
- InternalUserCancelledException.cs
- ConfigXmlComment.cs
- AmbientValueAttribute.cs
- Polyline.cs
- SortedSetDebugView.cs
- DataControlButton.cs
- ObjectSet.cs
- SqlCachedBuffer.cs
- TaskFileService.cs
- ProfilePropertySettingsCollection.cs
- VariableAction.cs
- MessagePropertyFilter.cs
- AuthorizationBehavior.cs
- GuidConverter.cs
- WebPartConnectionsDisconnectVerb.cs
- XmlSchemaObjectTable.cs
- CompilerGeneratedAttribute.cs
- SizeFConverter.cs
- QueuePathDialog.cs
- FileChangesMonitor.cs
- DataGridViewImageCell.cs
- ListViewAutomationPeer.cs
- MessagePropertyFilter.cs
- HtmlEmptyTagControlBuilder.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- DataSourceControl.cs
- RadioButtonAutomationPeer.cs
- FontSourceCollection.cs
- DESCryptoServiceProvider.cs
- AssemblyCollection.cs
- ToolStripDropDownMenu.cs
- ChildDocumentBlock.cs
- DetailsView.cs
- VerificationException.cs
- ListViewTableCell.cs
- DesignBindingValueUIHandler.cs
- XmlSchemaNotation.cs
- MemberListBinding.cs
- VectorCollection.cs
- Memoizer.cs
- CodeSnippetStatement.cs
- Activation.cs
- RegisteredScript.cs
- SeparatorAutomationPeer.cs
- SqlRemoveConstantOrderBy.cs