Struct XmlSerializedDateTimeOffset
A DateTimeOffset serialized in XML.
public record struct XmlSerializedDateTimeOffset : IXmlSerializable, IComparable<XmlSerializedDateTimeOffset>, IComparable, IFormattable, IEquatable<XmlSerializedDateTimeOffset>
- Implements
- Inherited Members
Constructors
XmlSerializedDateTimeOffset(DateTimeOffset)
Creates an instance of the XmlSerializedDateTimeOffset struct.
public XmlSerializedDateTimeOffset(DateTimeOffset value)
Parameters
valueDateTimeOffset- The date time offset value.
Properties
Value
The date time offset value.
public DateTimeOffset Value { readonly get; set; }
Property Value
Methods
CompareTo(XmlSerializedDateTimeOffset)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public readonly int CompareTo(XmlSerializedDateTimeOffset other)
Parameters
otherXmlSerializedDateTimeOffset- An object to compare with this instance.
Returns
- int
- A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value
Meaning
Less than zero
This instance precedes
otherin the sort order. Zero This instance occurs in the same position in the sort order asother. Greater than zero This instance followsotherin the sort order.
CompareTo(object?)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public readonly int CompareTo(object? obj)
Parameters
objobject- An object to compare with this instance.
Returns
- int
- A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value
Meaning
Less than zero
This instance precedes
objin the sort order. Zero This instance occurs in the same position in the sort order asobj. Greater than zero This instance followsobjin the sort order.
Exceptions
- ArgumentException
objis not the same type as this instance.
FromDateTimeOffset(DateTimeOffset)
Converts an instance of the DateTimeOffset struct to an instance of the XmlSerializedDateTimeOffset struct.
public static XmlSerializedDateTimeOffset FromDateTimeOffset(DateTimeOffset value)
Parameters
valueDateTimeOffset- An instance of the DateTimeOffset struct.
Returns
- XmlSerializedDateTimeOffset
- An instance of the XmlSerializedDateTimeOffset struct.
GetSchema()
This method is reserved and should not be used. When implementing the
IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the XmlSchemaProviderAttribute to the class.public readonly XmlSchema? GetSchema()
Returns
- XmlSchema
- An XmlSchema that describes the XML representation of the object that is produced by the WriteXml(XmlWriter) method and consumed by the ReadXml(XmlReader) method.
ReadXml(XmlReader)
Generates an object from its XML representation.
public void ReadXml(XmlReader reader)
Parameters
ToDateTimeOffset()
Converts the current instance to an instance of the DateTimeOffset struct.
public readonly DateTimeOffset ToDateTimeOffset()
Returns
- DateTimeOffset
- An instance of the DateTimeOffset struct.
ToString()
Returns the fully qualified type name of this instance.
public override readonly string ToString()
Returns
- string
- The fully qualified type name.
ToString(IFormatProvider?)
public readonly string ToString(IFormatProvider? formatProvider)
Parameters
formatProviderIFormatProvider
Returns
ToString(string?)
public readonly string ToString(string? format)
Parameters
formatstring
Returns
ToString(string?, IFormatProvider?)
Formats the value of the current instance using the specified format.
public readonly string ToString(string? format, IFormatProvider? formatProvider)
Parameters
formatstring- The format to use.
-or-
A null reference (
Nothingin Visual Basic) to use the default format defined for the type of the IFormattable implementation. formatProviderIFormatProvider- The provider to use to format the value.
-or-
A null reference (
Nothingin Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
Returns
- string
- The value of the current instance in the specified format.
WriteXml(XmlWriter)
Converts an object into its XML representation.
public readonly void WriteXml(XmlWriter writer)
Parameters
Operators
operator >(XmlSerializedDateTimeOffset, XmlSerializedDateTimeOffset)
public static bool operator >(XmlSerializedDateTimeOffset left, XmlSerializedDateTimeOffset right)
Parameters
Returns
operator >=(XmlSerializedDateTimeOffset, XmlSerializedDateTimeOffset)
public static bool operator >=(XmlSerializedDateTimeOffset left, XmlSerializedDateTimeOffset right)
Parameters
Returns
implicit operator DateTimeOffset(XmlSerializedDateTimeOffset)
Converts an instance of the XmlSerializedDateTimeOffset struct to an instance of the DateTimeOffset struct.
public static implicit operator DateTimeOffset(XmlSerializedDateTimeOffset value)
Parameters
valueXmlSerializedDateTimeOffset- An instance of the XmlSerializedDateTimeOffset struct.
Returns
implicit operator XmlSerializedDateTimeOffset(DateTimeOffset)
Converts an instance of the DateTimeOffset struct to an instance of the XmlSerializedDateTimeOffset struct.
public static implicit operator XmlSerializedDateTimeOffset(DateTimeOffset value)
Parameters
valueDateTimeOffset- An instance of the DateTimeOffset struct.
Returns
operator <(XmlSerializedDateTimeOffset, XmlSerializedDateTimeOffset)
public static bool operator <(XmlSerializedDateTimeOffset left, XmlSerializedDateTimeOffset right)
Parameters
Returns
operator <=(XmlSerializedDateTimeOffset, XmlSerializedDateTimeOffset)
public static bool operator <=(XmlSerializedDateTimeOffset left, XmlSerializedDateTimeOffset right)