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
- ExportOptions.cs
- ElementAtQueryOperator.cs
- AppDomainUnloadedException.cs
- DataContractSerializerOperationBehavior.cs
- BitmapPalette.cs
- JavaScriptObjectDeserializer.cs
- SecondaryIndexDefinition.cs
- MarshalByRefObject.cs
- InheritedPropertyChangedEventArgs.cs
- AssemblyAttributesGoHere.cs
- DrawToolTipEventArgs.cs
- MsmqInputSessionChannel.cs
- UTF7Encoding.cs
- QualifierSet.cs
- controlskin.cs
- ProtectedConfigurationSection.cs
- Vector3DValueSerializer.cs
- KeyedCollection.cs
- Control.cs
- FacetDescriptionElement.cs
- HMACSHA1.cs
- Adorner.cs
- TaskExceptionHolder.cs
- URL.cs
- ZoneMembershipCondition.cs
- infer.cs
- XPathEmptyIterator.cs
- Control.cs
- Parameter.cs
- EdmMember.cs
- CodeLabeledStatement.cs
- PlainXmlDeserializer.cs
- ErrorActivity.cs
- DayRenderEvent.cs
- TreeNode.cs
- TextBoxBase.cs
- CapabilitiesState.cs
- TextFormatter.cs
- DataGridViewComboBoxEditingControl.cs
- MsmqChannelListenerBase.cs
- TextEffect.cs
- TableRowCollection.cs
- DemultiplexingClientMessageFormatter.cs
- DesignerActionItemCollection.cs
- RijndaelManaged.cs
- XmlAttributeAttribute.cs
- ExtenderControl.cs
- _FixedSizeReader.cs
- CustomAttributeFormatException.cs
- SrgsText.cs
- ClientSettings.cs
- printdlgexmarshaler.cs
- HttpBufferlessInputStream.cs
- MemberInitExpression.cs
- Int32Animation.cs
- ProgressBarAutomationPeer.cs
- WsrmFault.cs
- TargetControlTypeCache.cs
- OperationAbortedException.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- SqlMetaData.cs
- EtwTrackingParticipant.cs
- OutputScopeManager.cs
- EdmFunctions.cs
- FusionWrap.cs
- Route.cs
- XmlSchemaIdentityConstraint.cs
- ChtmlFormAdapter.cs
- coordinator.cs
- PageSetupDialog.cs
- PersonalizableAttribute.cs
- GeneratedCodeAttribute.cs
- __ConsoleStream.cs
- BitmapEffectGeneralTransform.cs
- DataGridViewIntLinkedList.cs
- RuleSetDialog.cs
- TextChangedEventArgs.cs
- ResourceExpressionBuilder.cs
- DataGridItem.cs
- GreaterThanOrEqual.cs
- PriorityQueue.cs
- XamlTreeBuilderBamlRecordWriter.cs
- ApplicationId.cs
- ReferencedCategoriesDocument.cs
- CollectionChangedEventManager.cs
- MergeFailedEvent.cs
- ToolStripOverflow.cs
- OleDbError.cs
- WriteLineDesigner.xaml.cs
- AddInContractAttribute.cs
- SmtpReplyReader.cs
- RsaKeyIdentifierClause.cs
- TrackingMemoryStream.cs
- HideDisabledControlAdapter.cs
- ConditionalAttribute.cs
- BulletedListEventArgs.cs
- XmlElementList.cs
- XmlSchemaComplexType.cs
- QilInvokeLateBound.cs
- Vector3D.cs