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
- SelectionHighlightInfo.cs
- ToolStripPanelRenderEventArgs.cs
- Camera.cs
- SmtpCommands.cs
- DefaultSerializationProviderAttribute.cs
- StoryFragments.cs
- ThreadInterruptedException.cs
- PropertyCollection.cs
- GatewayDefinition.cs
- GenerateTemporaryTargetAssembly.cs
- DetailsViewCommandEventArgs.cs
- WebConfigurationManager.cs
- RangeBase.cs
- MD5CryptoServiceProvider.cs
- CorePropertiesFilter.cs
- DependencyPropertyKind.cs
- OrderPreservingPipeliningSpoolingTask.cs
- GeometryConverter.cs
- ContentType.cs
- FullTrustAssemblyCollection.cs
- HwndStylusInputProvider.cs
- XsdBuilder.cs
- MembershipPasswordException.cs
- WebControlAdapter.cs
- RepeatButtonAutomationPeer.cs
- CommonDialog.cs
- SerialPinChanges.cs
- DateTimeValueSerializer.cs
- webproxy.cs
- ArgumentNullException.cs
- EncodingStreamWrapper.cs
- Resources.Designer.cs
- CharConverter.cs
- HtmlTableRow.cs
- XXXOnTypeBuilderInstantiation.cs
- DefaultHttpHandler.cs
- WmlObjectListAdapter.cs
- ParameterCollection.cs
- RewritingValidator.cs
- DefaultMemberAttribute.cs
- ImmutableObjectAttribute.cs
- ManualWorkflowSchedulerService.cs
- DataGridViewButtonCell.cs
- XmlSerializerSection.cs
- QuaternionConverter.cs
- BaseTreeIterator.cs
- ChangePassword.cs
- log.cs
- GraphicsPathIterator.cs
- ApplicationContext.cs
- SecuritySessionSecurityTokenProvider.cs
- BaseInfoTable.cs
- HttpSessionStateBase.cs
- HttpCacheParams.cs
- SoapSchemaMember.cs
- TaiwanCalendar.cs
- TextSpan.cs
- ThumbAutomationPeer.cs
- EntityDataSourceValidationException.cs
- Operators.cs
- StringDictionary.cs
- UnsafeMethods.cs
- ClockGroup.cs
- XmlSerializationWriter.cs
- SystemNetHelpers.cs
- BufferModeSettings.cs
- SubMenuStyleCollection.cs
- FormViewDeletedEventArgs.cs
- FormClosingEvent.cs
- TextElementEditingBehaviorAttribute.cs
- BitmapImage.cs
- DataGridToolTip.cs
- BCryptHashAlgorithm.cs
- Pool.cs
- StyleModeStack.cs
- SafeNativeMethods.cs
- TypeSystem.cs
- Descriptor.cs
- Lease.cs
- ConfigurationValues.cs
- HttpClientCertificate.cs
- PropertyEmitter.cs
- SoapConverter.cs
- IndexedString.cs
- ToolStripProgressBar.cs
- SessionViewState.cs
- XpsResourcePolicy.cs
- DataMemberFieldEditor.cs
- HyperLink.cs
- UriTemplateLiteralQueryValue.cs
- EditCommandColumn.cs
- DataGridCellInfo.cs
- TargetException.cs
- SimpleWebHandlerParser.cs
- GenericAuthenticationEventArgs.cs
- Expression.cs
- base64Transforms.cs
- ApplicationSecurityInfo.cs
- ExpressionBuilderContext.cs
- ItemAutomationPeer.cs