Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ConfigurationValidatorBase.cs
- FormatterServices.cs
- followingquery.cs
- SqlClientFactory.cs
- ClientConfigPaths.cs
- FirstMatchCodeGroup.cs
- DateTimeStorage.cs
- ErrorStyle.cs
- NativeActivityFaultContext.cs
- GradientStopCollection.cs
- coordinatorscratchpad.cs
- XmlNodeChangedEventManager.cs
- _FtpControlStream.cs
- PropertyEmitter.cs
- ControlLocalizer.cs
- RectConverter.cs
- SafeFileMappingHandle.cs
- ComponentCollection.cs
- ScriptingWebServicesSectionGroup.cs
- TaskFileService.cs
- SpellerHighlightLayer.cs
- EncodingInfo.cs
- WinEventHandler.cs
- Pkcs9Attribute.cs
- ComboBoxItem.cs
- RichTextBoxAutomationPeer.cs
- Property.cs
- MetafileHeaderWmf.cs
- Configuration.cs
- SaveFileDialog.cs
- NotEqual.cs
- SecurityContextTokenValidationException.cs
- SqlException.cs
- SQLString.cs
- DesignerDataTableBase.cs
- JoinSymbol.cs
- TypeListConverter.cs
- ContextBase.cs
- BitmapCodecInfo.cs
- CompareValidator.cs
- ServiceOperationUIEditor.cs
- Substitution.cs
- XmlAutoDetectWriter.cs
- OpenTypeLayoutCache.cs
- XmlTextReader.cs
- XmlSchemaComplexType.cs
- ViewStateException.cs
- SignatureConfirmationElement.cs
- FormsIdentity.cs
- WebPartConnectionsCloseVerb.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- NTAccount.cs
- AlphabetConverter.cs
- ResourceDescriptionAttribute.cs
- PrintEvent.cs
- Globals.cs
- LicenseProviderAttribute.cs
- PresentationSource.cs
- CommandDevice.cs
- Listener.cs
- CompiledRegexRunner.cs
- ObjectSecurity.cs
- DispatchChannelSink.cs
- _CookieModule.cs
- CodeCastExpression.cs
- ToolStripItemEventArgs.cs
- Repeater.cs
- GenerateTemporaryTargetAssembly.cs
- ResourceWriter.cs
- XmlSerializerAssemblyAttribute.cs
- ITextView.cs
- SQLInt16.cs
- XmlUtil.cs
- XmlSchemaValidationException.cs
- remotingproxy.cs
- LinearKeyFrames.cs
- ResXResourceReader.cs
- WebPartHelpVerb.cs
- prompt.cs
- ImportContext.cs
- ToolStripItemRenderEventArgs.cs
- WindowsIdentity.cs
- SQLInt64Storage.cs
- x509utils.cs
- TreeWalkHelper.cs
- DropShadowBitmapEffect.cs
- InheritanceAttribute.cs
- PrintPageEvent.cs
- NetPeerTcpBindingCollectionElement.cs
- ArraySubsetEnumerator.cs
- EndpointAddress.cs
- RolePrincipal.cs
- WebConfigurationHost.cs
- DbSetClause.cs
- RoutedEventArgs.cs
- SkipQueryOptionExpression.cs
- PropertyToken.cs
- MaskInputRejectedEventArgs.cs
- ConfigXmlAttribute.cs
- SqlErrorCollection.cs