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
- DataGridItemAutomationPeer.cs
- ComNativeDescriptor.cs
- RemotingException.cs
- ImageListStreamer.cs
- CaseInsensitiveComparer.cs
- FixedSchema.cs
- LogSwitch.cs
- SrgsGrammar.cs
- RectKeyFrameCollection.cs
- IntSecurity.cs
- BamlLocalizer.cs
- HtmlUtf8RawTextWriter.cs
- PropertySegmentSerializationProvider.cs
- ArraySegment.cs
- LongMinMaxAggregationOperator.cs
- XmlSchemaSequence.cs
- AuthorizationRuleCollection.cs
- UserControl.cs
- ServerReliableChannelBinder.cs
- DataView.cs
- ADConnectionHelper.cs
- EdmSchemaError.cs
- AssemblyAttributesGoHere.cs
- AdjustableArrowCap.cs
- FixedSOMTextRun.cs
- Rectangle.cs
- RepeatInfo.cs
- ObjectRef.cs
- HatchBrush.cs
- ManagedWndProcTracker.cs
- DesignerAttribute.cs
- ImageSource.cs
- Track.cs
- AuthenticodeSignatureInformation.cs
- VectorAnimation.cs
- SplineKeyFrames.cs
- LocationSectionRecord.cs
- ConfigurationManagerHelper.cs
- ArgumentNullException.cs
- GeneralTransform3DTo2DTo3D.cs
- Operand.cs
- ObjectStateEntryDbDataRecord.cs
- WSSecureConversation.cs
- Perspective.cs
- DayRenderEvent.cs
- ThreadSafeList.cs
- ProviderMetadataCachedInformation.cs
- CheckPair.cs
- TextRunCache.cs
- StreamingContext.cs
- ObjectStateEntryDbDataRecord.cs
- X509SecurityTokenAuthenticator.cs
- SerializationTrace.cs
- DesignerActionPanel.cs
- DataServiceRequestOfT.cs
- AspNetSynchronizationContext.cs
- DataFieldConverter.cs
- ImageField.cs
- MethodImplAttribute.cs
- GetUserPreferenceRequest.cs
- GenericArgumentsUpdater.cs
- WebPartUtil.cs
- ArgumentNullException.cs
- Function.cs
- ManagedIStream.cs
- ClientScriptManager.cs
- CommentEmitter.cs
- ColumnHeaderCollectionEditor.cs
- SiteMapProvider.cs
- ImportContext.cs
- LabelEditEvent.cs
- Tokenizer.cs
- HelpEvent.cs
- CompositeCollection.cs
- ValidationResult.cs
- TypeSystem.cs
- Transform3D.cs
- DescendantOverDescendantQuery.cs
- WebPartPersonalization.cs
- ExpressionBinding.cs
- DrawingContextDrawingContextWalker.cs
- UrlMappingCollection.cs
- IdentityValidationException.cs
- TokenCreationParameter.cs
- ResourceType.cs
- Italic.cs
- ContentFileHelper.cs
- LongMinMaxAggregationOperator.cs
- ModifierKeysConverter.cs
- Polyline.cs
- FixedTextBuilder.cs
- WebBrowser.cs
- ExpressionBuilderContext.cs
- DataGridHeaderBorder.cs
- DataGridViewRowCancelEventArgs.cs
- QilLiteral.cs
- ToolZone.cs
- DllNotFoundException.cs
- CompressedStack.cs
- CollectionViewProxy.cs