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
- EndpointDispatcher.cs
- PrintController.cs
- BindingsCollection.cs
- TypeElement.cs
- ListItem.cs
- PeerResolverSettings.cs
- CLSCompliantAttribute.cs
- RemotingException.cs
- DictionaryEditChange.cs
- SqlDataReaderSmi.cs
- ChildTable.cs
- WindowsBrush.cs
- DragEvent.cs
- EntityDataSourceEntitySetNameItem.cs
- AtomMaterializer.cs
- ViewRendering.cs
- ViewStateModeByIdAttribute.cs
- ButtonRenderer.cs
- UnauthorizedAccessException.cs
- ConstrainedDataObject.cs
- EditBehavior.cs
- Model3D.cs
- ListBase.cs
- ReadOnlyDictionary.cs
- ObjectStateManagerMetadata.cs
- PopupControlService.cs
- BamlTreeNode.cs
- UrlMappingsSection.cs
- WsdlImporterElementCollection.cs
- Utils.cs
- SqlDelegatedTransaction.cs
- ChtmlMobileTextWriter.cs
- AppManager.cs
- TTSEngineProxy.cs
- BitStream.cs
- ZipIORawDataFileBlock.cs
- Attributes.cs
- XsltQilFactory.cs
- SqlReorderer.cs
- QilExpression.cs
- ProxyBuilder.cs
- AlignmentXValidation.cs
- MatrixIndependentAnimationStorage.cs
- File.cs
- MediaTimeline.cs
- DataObjectAttribute.cs
- KeyValueConfigurationElement.cs
- Trace.cs
- Int32Collection.cs
- FolderBrowserDialog.cs
- ExpressionBuilderContext.cs
- IconConverter.cs
- TriggerBase.cs
- MaskedTextBoxTextEditor.cs
- EdmMember.cs
- MarginCollapsingState.cs
- AssociationSetMetadata.cs
- NamespaceInfo.cs
- DataGridGeneralPage.cs
- X509SecurityTokenProvider.cs
- TextClipboardData.cs
- ToolStripDropDownClosingEventArgs.cs
- TextElementAutomationPeer.cs
- MetadataCollection.cs
- WmfPlaceableFileHeader.cs
- PageStatePersister.cs
- TypeDescriptionProvider.cs
- DataGridViewCheckBoxColumn.cs
- Ref.cs
- FieldValue.cs
- PropertyValueChangedEvent.cs
- SqlMultiplexer.cs
- XmlHelper.cs
- BlockingCollection.cs
- AssociationEndMember.cs
- _ConnectOverlappedAsyncResult.cs
- SubpageParagraph.cs
- ListComponentEditorPage.cs
- SqlDataSourceQuery.cs
- iisPickupDirectory.cs
- HashCodeCombiner.cs
- _ConnectionGroup.cs
- DefaultExpressionVisitor.cs
- _Rfc2616CacheValidators.cs
- _TimerThread.cs
- SystemNetHelpers.cs
- DocumentOrderQuery.cs
- ObjectSecurityT.cs
- DrawingGroup.cs
- NavigationEventArgs.cs
- DataGridPagerStyle.cs
- DateTimeOffsetStorage.cs
- ByteAnimation.cs
- EpmTargetPathSegment.cs
- ImageAnimator.cs
- CharStorage.cs
- XmlObjectSerializerContext.cs
- Matrix.cs
- PassportAuthenticationEventArgs.cs
- XmlQueryStaticData.cs