Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Base / MS / Internal / Markup / TypeConverterValueSerializer.cs / 2 / TypeConverterValueSerializer.cs
//------------------------------------------------------------------------ // // Microsoft Windows Client Platform // Copyright (C) Microsoft Corporation, 2005 // // File: TypeConverterValueSerializer.cs // // Contents: TypeConverter to ValueSerializer adapter // // Created: 04/28/2005 [....] // //----------------------------------------------------------------------- using System.ComponentModel; using System.Globalization; using System.Windows.Markup; namespace MS.Internal.Serialization { ////// The TypeConverter value serializer uses a TypeConverter to implement the translation /// to and from a string. The caller of the constructor must ensure the TypeConverter supports /// converstion to and from string. /// internal sealed class TypeConverterValueSerializer : ValueSerializer { private TypeConverter converter; public TypeConverterValueSerializer(TypeConverter converter) { this.converter = converter; } public override bool CanConvertToString(object value, IValueSerializerContext context) { return converter.CanConvertTo(context, typeof(string)); } public override string ConvertToString(object value, IValueSerializerContext context) { return converter.ConvertToString(context, System.Windows.Markup.TypeConverterHelper.EnglishUSCulture, value); } public override bool CanConvertFromString(string value, IValueSerializerContext context) { return true; } public override object ConvertFromString(string value, IValueSerializerContext context) { return converter.ConvertFrom(context, System.Windows.Markup.TypeConverterHelper.EnglishUSCulture, value); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------ // // Microsoft Windows Client Platform // Copyright (C) Microsoft Corporation, 2005 // // File: TypeConverterValueSerializer.cs // // Contents: TypeConverter to ValueSerializer adapter // // Created: 04/28/2005 [....] // //----------------------------------------------------------------------- using System.ComponentModel; using System.Globalization; using System.Windows.Markup; namespace MS.Internal.Serialization { ////// The TypeConverter value serializer uses a TypeConverter to implement the translation /// to and from a string. The caller of the constructor must ensure the TypeConverter supports /// converstion to and from string. /// internal sealed class TypeConverterValueSerializer : ValueSerializer { private TypeConverter converter; public TypeConverterValueSerializer(TypeConverter converter) { this.converter = converter; } public override bool CanConvertToString(object value, IValueSerializerContext context) { return converter.CanConvertTo(context, typeof(string)); } public override string ConvertToString(object value, IValueSerializerContext context) { return converter.ConvertToString(context, System.Windows.Markup.TypeConverterHelper.EnglishUSCulture, value); } public override bool CanConvertFromString(string value, IValueSerializerContext context) { return true; } public override object ConvertFromString(string value, IValueSerializerContext context) { return converter.ConvertFrom(context, System.Windows.Markup.TypeConverterHelper.EnglishUSCulture, value); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BamlRecordWriter.cs
- State.cs
- TransferRequestHandler.cs
- HttpRawResponse.cs
- FilteredReadOnlyMetadataCollection.cs
- ConfigurationValues.cs
- HttpHeaderCollection.cs
- TreeNodeBinding.cs
- IDQuery.cs
- HtmlInputText.cs
- ElementUtil.cs
- Win32Exception.cs
- PrivilegeNotHeldException.cs
- ProtocolProfile.cs
- ServiceDocument.cs
- _UriTypeConverter.cs
- ServiceNotStartedException.cs
- Control.cs
- StructuredTypeInfo.cs
- TypeCollectionPropertyEditor.cs
- CodeTypeParameterCollection.cs
- HttpMethodAttribute.cs
- SymmetricAlgorithm.cs
- DbDeleteCommandTree.cs
- CompareInfo.cs
- CodeDomSerializerBase.cs
- AdapterSwitches.cs
- RuleInfoComparer.cs
- DetailsViewInsertedEventArgs.cs
- ClientUtils.cs
- ObfuscationAttribute.cs
- HttpModuleActionCollection.cs
- MessageSecurityProtocolFactory.cs
- ObjectCacheSettings.cs
- TdsParserHelperClasses.cs
- XhtmlBasicSelectionListAdapter.cs
- WebBrowser.cs
- ScaleTransform3D.cs
- InternalSafeNativeMethods.cs
- ScrollBarAutomationPeer.cs
- Pair.cs
- Pkcs7Signer.cs
- ColumnHeaderConverter.cs
- MultiPageTextView.cs
- ParseElement.cs
- RepeatBehavior.cs
- MatrixAnimationBase.cs
- securitycriticaldataClass.cs
- NumericUpDownAccelerationCollection.cs
- SHA256.cs
- SqlRowUpdatingEvent.cs
- ExceptionHelpers.cs
- ProxySimple.cs
- ScriptIgnoreAttribute.cs
- DataRowCollection.cs
- RadioButtonRenderer.cs
- dtdvalidator.cs
- Unit.cs
- Bezier.cs
- Events.cs
- WindowsComboBox.cs
- LogEntrySerializer.cs
- ImageSourceValueSerializer.cs
- ReadOnlyDictionary.cs
- ConfigXmlAttribute.cs
- SemaphoreFullException.cs
- SetterTriggerConditionValueConverter.cs
- Binding.cs
- TabPageDesigner.cs
- User.cs
- IODescriptionAttribute.cs
- CssClassPropertyAttribute.cs
- StringResourceManager.cs
- CategoryValueConverter.cs
- BooleanAnimationUsingKeyFrames.cs
- safesecurityhelperavalon.cs
- ValueSerializer.cs
- RegisterResponseInfo.cs
- RtfControlWordInfo.cs
- XPathDocumentNavigator.cs
- EntityContainer.cs
- CodeNamespaceImport.cs
- SoapAttributeAttribute.cs
- keycontainerpermission.cs
- DataListItem.cs
- TextServicesCompartment.cs
- RC2CryptoServiceProvider.cs
- Atom10FormatterFactory.cs
- ValidateNames.cs
- FilterableAttribute.cs
- WebService.cs
- XmlSchemaSubstitutionGroup.cs
- SQLGuidStorage.cs
- TrackingProfileDeserializationException.cs
- SiteMapSection.cs
- DbParameterHelper.cs
- TextEndOfParagraph.cs
- AppDomainUnloadedException.cs
- RuntimeHelpers.cs
- StatementContext.cs