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
- Converter.cs
- SubMenuStyle.cs
- SoapAttributeAttribute.cs
- QuaternionRotation3D.cs
- BitmapPalette.cs
- Button.cs
- UInt16Converter.cs
- ServiceOperationUIEditor.cs
- SurrogateSelector.cs
- _ChunkParse.cs
- DynamicDocumentPaginator.cs
- StringBuilder.cs
- ValueQuery.cs
- TypedTableBase.cs
- CodeDomSerializationProvider.cs
- WebServiceEnumData.cs
- EntityProviderFactory.cs
- QuaternionRotation3D.cs
- RedistVersionInfo.cs
- HttpCapabilitiesSectionHandler.cs
- AnnotationService.cs
- DesignerToolStripControlHost.cs
- IIS7ConfigurationLoader.cs
- ComponentDispatcherThread.cs
- RegisteredExpandoAttribute.cs
- SamlDoNotCacheCondition.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- KeyboardNavigation.cs
- RequestSecurityTokenForGetBrowserToken.cs
- GroupStyle.cs
- XmlElementList.cs
- Timer.cs
- Dynamic.cs
- RenameRuleObjectDialog.cs
- SmiEventSink.cs
- DateTimeUtil.cs
- _ProxyRegBlob.cs
- CompilationSection.cs
- ServiceHostFactory.cs
- LinqDataSourceUpdateEventArgs.cs
- MaskDesignerDialog.cs
- SHA1.cs
- XmlSchemaValidator.cs
- EdmItemCollection.OcAssemblyCache.cs
- DataServiceClientException.cs
- AttachedAnnotation.cs
- MonitorWrapper.cs
- ArgumentReference.cs
- Panel.cs
- IntSecurity.cs
- BoolExpression.cs
- PermissionRequestEvidence.cs
- CancelEventArgs.cs
- Viewport3DAutomationPeer.cs
- MsdtcWrapper.cs
- HtmlDocument.cs
- DrawTreeNodeEventArgs.cs
- IPEndPoint.cs
- Repeater.cs
- DbTransaction.cs
- WriterOutput.cs
- Point3DCollectionConverter.cs
- SystemResourceKey.cs
- TransactionProtocolConverter.cs
- ProtocolsConfiguration.cs
- DefaultAuthorizationContext.cs
- ProvideValueServiceProvider.cs
- shaperfactory.cs
- UserControlCodeDomTreeGenerator.cs
- ThreadAbortException.cs
- SetStoryboardSpeedRatio.cs
- ObjectSecurity.cs
- XmlTextWriter.cs
- FileDialogCustomPlace.cs
- XmlSerializerOperationFormatter.cs
- DataGridViewRowPostPaintEventArgs.cs
- XmlEncoding.cs
- KeyValuePair.cs
- AnnotationDocumentPaginator.cs
- GradientBrush.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- BuildManager.cs
- TreeNodeBinding.cs
- ContentValidator.cs
- EntityParameterCollection.cs
- DbConnectionStringBuilder.cs
- TimeSpanFormat.cs
- TextWriterTraceListener.cs
- RowCache.cs
- arabicshape.cs
- _SslStream.cs
- FileDialog.cs
- FontFamily.cs
- recordstatefactory.cs
- VideoDrawing.cs
- StoreItemCollection.Loader.cs
- DockPanel.cs
- DesignerVerbToolStripMenuItem.cs
- ObjectListCommandsPage.cs
- SerializationException.cs