Show / Hide Table of Contents

Class DateTimeConverter

A converter for handling System.DateTime values in line with how classical serialization handles them.

Inheritance
System.Object
DecoratedSpecification<System.Reflection.TypeInfo>
ConverterBase<System.DateTime>
DateTimeConverter
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 sealed class DateTimeConverter : ConverterBase<DateTime>, IConverter<DateTime>, ISpecification<TypeInfo>, IConvert<DateTime>

Constructors

DateTimeConverter(XmlDateTimeSerializationMode)

Creates a new instance with the provided mode.

Declaration
public DateTimeConverter(XmlDateTimeSerializationMode mode)
Parameters
System.Xml.XmlDateTimeSerializationMode mode

The mode used to handle conversion for provided DateTime instances.

Properties

Default

The default instance of this converter.

Declaration
public static DateTimeConverter Default { get; }
Property Value
DateTimeConverter

Local

A local variant of this converter. This is called with System.Xml.XmlDateTimeSerializationMode.Local.

Declaration
public static DateTimeConverter Local { get; }
Property Value
DateTimeConverter

Methods

Format(DateTime)

Used to format the provided instance into its text representation.

Declaration
public override string Format(DateTime instance)
Parameters
System.DateTime instance

Returns
System.String

The string representation of the provided instance.

Overrides
ExtendedXmlSerializer.ContentModel.Conversion.ConverterBase<System.DateTime>.Format(System.DateTime)

Parse(String)

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

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

The text from which to create a new instance.

Returns
System.DateTime

An instance created from the provided text.

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

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)
ExtensionMethodsForContentModel.Structured<T>(IConverter<T>)
ExtensionMethodsForContentModel.Adapt<T>(IConverter<T>)
ExtensionMethodsForCoreSources.If<TParameter, TResult>(TResult, ISpecification<TParameter>)
ExtensionMethodsForCoreSources.Let<TSpecification, TInstance>(TInstance, ISpecification<TSpecification>, TInstance)
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