Class Converter<T>
A delegate-based converter used as a convenience for extension authors.
Inherited Members
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
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
Explicit Interface Implementations
IConvert<Object>.Format(Object)
Declaration
string IConvert<object>.Format(object instance)
Parameters
System.Object
instance
|
Returns
System.String
|
Implements
IConvert<Object>.Parse(String)
Declaration
object IConvert<object>.Parse(string data)
Parameters
System.String
data
|
Returns
System.Object
|
Implements
ISource<TypeInfo>.Get()
Declaration
TypeInfo ISource<TypeInfo>.Get()
Returns
System.Reflection.TypeInfo
|