Show / Hide Table of Contents

Class Converter<T>

A delegate-based converter used as a convenience for extension authors.

Inheritance
System.Object
DecoratedSpecification<System.Reflection.TypeInfo>
ConverterBase<T>
Converter<T>
VersionConverter
Inherited Members
DecoratedSpecification<TypeInfo>.IsSatisfiedBy(TypeInfo)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ExtendedXmlSerializer.ContentModel.Conversion
Assembly: ExtendedXmlSerializer.dll
Syntax
public class Converter<T> : ConverterBase<T>, IConverter<T>, IConvert<T>, IConverter, IConverter<object>, ISpecification<TypeInfo>, IConvert<object>, ISource<TypeInfo>
Type Parameters
T

The type to convert.

Constructors

Converter(ISpecification<TypeInfo>, Func<String, T>, Func<T, String>)

Creates a new instance.

Declaration
public Converter(ISpecification<TypeInfo> specification, Func<string, T> deserialize, Func<T, string> serialize)
Parameters
ISpecification<System.Reflection.TypeInfo> specification

The specification that determines whether the created converter handles the candidate type.

System.Func<System.String, T> deserialize

The deserialization delegate used to create the instance from the provided text.

System.Func<T, System.String> serialize

The serialization delegate used to create the text form of the provided instance.

Converter(Func<String, T>, Func<T, String>)

Creates a new instance.

Declaration
public Converter(Func<string, T> deserialize, Func<T, string> serialize)
Parameters
System.Func<System.String, T> deserialize

The deserialization delegate used to create the instance from the provided text.

System.Func<T, System.String> serialize

The serialization delegate used to create the text form of the provided instance.

Methods

Format(T)

Used to format the provided instance into its text representation.

Declaration
public sealed override string Format(T instance)
Parameters
T instance

The instance to convert into a text string.

Returns
System.String

The string representation of the provided instance.

Overrides
ExtendedXmlSerializer.ContentModel.Conversion.ConverterBase<T>.Format(T)

Parse(String)

Used to parse the provided text into a new instance of the converter type.

Declaration
public sealed override T Parse(string data)
Parameters
System.String data

The text from which to create a new instance.

Returns
T

An instance created from the provided text.

Overrides
ExtendedXmlSerializer.ContentModel.Conversion.ConverterBase<T>.Parse(System.String)

Explicit Interface Implementations

IConvert<Object>.Format(Object)

Declaration
string IConvert<object>.Format(object instance)
Parameters
System.Object instance

Returns
System.String

Implements
IConvert<T>.Format(T)

IConvert<Object>.Parse(String)

Declaration
object IConvert<object>.Parse(string data)
Parameters
System.String data

Returns
System.Object

Implements
IConvert<T>.Parse(String)

ISource<TypeInfo>.Get()

Declaration
TypeInfo ISource<TypeInfo>.Get()
Returns
System.Reflection.TypeInfo

Implements
ISource<T>.Get()

Extension Methods

ExtensionMethods.Return<T, TOut>(T, TOut)
ExtensionMethods.To<T>(Object)
ExtensionMethods.AsValid<T>(Object, String)
ExtensionMethodsForAttachedProperties.Get<TType, TValue>(TType, Property<TType, TValue>)
ExtensionMethodsForAttachedProperties.Set<TType, TValue>(TType, Property<TType, TValue>, TValue)
ExtensionMethodsForConfiguration.GetType(ISource<TypeInfo>)
ExtensionMethodsForConfiguration.GetMember(ISource<MemberInfo>)
ExtensionMethodsForCoreSources.If<TParameter, TResult>(TResult, ISpecification<TParameter>)
ExtensionMethodsForCoreSources.Let<TSpecification, TInstance>(TInstance, ISpecification<TSpecification>, TInstance)
ExtensionMethodsForCoreSources.Singleton<T>(ISource<T>)
ExtensionMethodsForCoreSources.ToSourceDelegate<T>(ISource<T>)
ExtensionMethodsForCoreSources.ToDelegate<T>(ISource<T>)
ExtensionMethodsForCoreSpecifications.ToDelegate<T>(ISpecification<T>)
ExtensionMethodsForCoreSpecifications.Build<T>(ISpecification<TypeInfo>)
ExtensionMethodsForCoreSpecifications.Build<T>(ISpecification<T>, T)
ExtensionMethodsForCoreSpecifications.Fix<T>(ISpecification<T>, T)
ExtensionMethodsForCoreSpecifications.Any<T>(ISpecification<T>, T[])
ExtensionMethodsForCoreSpecifications.Or<T>(ISpecification<T>, ISpecification<T>[])
ExtensionMethodsForCoreSpecifications.And<T>(ISpecification<T>, ISpecification<T>[])
ExtensionMethodsForCoreSpecifications.Inverse<T>(ISpecification<T>)
ExtensionMethodsForCoreSpecifications.AdaptForNull<T>(ISpecification<T>)
ExtensionMethodsForCoreSpecifications.Adapt<T>(ISpecification<T>)
Back to top Generated by DocFX