Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Base / MS / Internal / Markup / TypeConverterValueSerializer.cs / 1 / TypeConverterValueSerializer.cs
//------------------------------------------------------------------------ // // Microsoft Windows Client Platform // Copyright (C) Microsoft Corporation, 2005 // // File: TypeConverterValueSerializer.cs // // Contents: TypeConverter to ValueSerializer adapter // // Created: 04/28/2005 chuckj // //----------------------------------------------------------------------- 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, CultureInfo.GetCultureInfo("en-us"), value); } public override bool CanConvertFromString(string value, IValueSerializerContext context) { return true; } public override object ConvertFromString(string value, IValueSerializerContext context) { return converter.ConvertFrom(context, CultureInfo.GetCultureInfo("en-us"), 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
- StringPropertyBuilder.cs
- XmlILAnnotation.cs
- BaseInfoTable.cs
- altserialization.cs
- SpellerInterop.cs
- InputMethodStateChangeEventArgs.cs
- ServiceParser.cs
- objectquery_tresulttype.cs
- Geometry3D.cs
- FileDialogPermission.cs
- PageRanges.cs
- ScriptDescriptor.cs
- UriParserTemplates.cs
- CodeCompiler.cs
- EventHandlersStore.cs
- ReadOnlyTernaryTree.cs
- ComProxy.cs
- DbProviderFactory.cs
- KeyFrames.cs
- ImageFormat.cs
- AgileSafeNativeMemoryHandle.cs
- TileModeValidation.cs
- _ListenerAsyncResult.cs
- TargetInvocationException.cs
- XpsSerializerFactory.cs
- SqlBulkCopyColumnMappingCollection.cs
- RegistrationServices.cs
- TaskFileService.cs
- UnsafeNativeMethodsMilCoreApi.cs
- SpecularMaterial.cs
- Table.cs
- FreeFormDragDropManager.cs
- GridSplitter.cs
- MgmtConfigurationRecord.cs
- WorkflowWebService.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- ConfigurationValidatorAttribute.cs
- DocumentSchemaValidator.cs
- IntegerValidatorAttribute.cs
- QilLiteral.cs
- SpAudioStreamWrapper.cs
- ListControl.cs
- TemplatedEditableDesignerRegion.cs
- Html32TextWriter.cs
- DbProviderConfigurationHandler.cs
- AnimationTimeline.cs
- WebScriptMetadataMessageEncodingBindingElement.cs
- InputChannelAcceptor.cs
- EnvironmentPermission.cs
- SqlColumnizer.cs
- TextTreeText.cs
- GeneralTransform3D.cs
- TypeConverterHelper.cs
- precedingquery.cs
- SQLDecimalStorage.cs
- JsonObjectDataContract.cs
- XmlSchemaChoice.cs
- GeneralTransformGroup.cs
- TextTreePropertyUndoUnit.cs
- EntityContainerRelationshipSetEnd.cs
- IntellisenseTextBox.cs
- HelpKeywordAttribute.cs
- HttpServerVarsCollection.cs
- PolyLineSegment.cs
- SerializationInfoEnumerator.cs
- FilterUserControlBase.cs
- CaseStatement.cs
- SqlBooleanMismatchVisitor.cs
- ApplicationCommands.cs
- RangeValuePattern.cs
- ServiceRouteHandler.cs
- UserNameSecurityTokenProvider.cs
- XmlWrappingReader.cs
- AccessibleObject.cs
- XmlSerializationReader.cs
- xml.cs
- ClientTargetSection.cs
- FrameworkElement.cs
- BitmapEffectGroup.cs
- DelayedRegex.cs
- DbConnectionPoolCounters.cs
- StateDesignerConnector.cs
- HostingEnvironmentException.cs
- WebContext.cs
- RMEnrollmentPage2.cs
- DeferredBinaryDeserializerExtension.cs
- SQLInt64Storage.cs
- DataSetUtil.cs
- LinearKeyFrames.cs
- RepeaterItemEventArgs.cs
- DiscreteKeyFrames.cs
- GridViewHeaderRowPresenter.cs
- TreeNodeClickEventArgs.cs
- ProcessHostMapPath.cs
- TextElement.cs
- Sequence.cs
- VisualBrush.cs
- TrackingStringDictionary.cs
- ActivityMarkupSerializer.cs
- ApplicationBuildProvider.cs