C# Class System.Xml.Schema.XsdDuration

This structure holds components of an Xsd Duration. It is used internally to support Xsd durations without loss of fidelity. XsdDuration structures are immutable once they've been created.
Afficher le fichier Open project: gbarnett/shared-source-cli-2.0 Class Usage Examples

Méthodes publiques

Méthode Description
Normalize ( ) : XsdDuration

Normalize year-month part and day-time part so that month < 12, hour < 24, minute < 60, and second < 60.

ToString ( ) : string

Return the string representation of this Xsd duration.

ToTimeSpan ( ) : System.TimeSpan

Internal helper method that converts an Xsd duration to a TimeSpan value. This code uses the estimate that there are 365 days in the year and 30 days in a month.

XsdDuration ( System.TimeSpan timeSpan ) : System

Construct an XsdDuration from a TimeSpan value.

XsdDuration ( bool isNegative, int years, int months, int days, int hours, int minutes, int seconds, int nanoseconds ) : System

Construct an XsdDuration from component parts.

XsdDuration ( string s ) : System

Constructs an XsdDuration from a string in the xsd:duration format. Components are stored with loss of fidelity (except in the case of overflow).

XsdDuration ( string s, DurationType durationType ) : System

Constructs an XsdDuration from a string in the xsd:duration format. Components are stored without loss of fidelity (except in the case of overflow).

Private Methods

Méthode Description
ToString ( DurationType durationType ) : string

Return the string representation according to xsd:duration rules, xdt:dayTimeDuration rules, or xdt:yearMonthDuration rules.

ToTimeSpan ( DurationType durationType ) : System.TimeSpan

Internal helper method that converts an Xsd duration to a TimeSpan value. This code uses the estimate that there are 365 days in the year and 30 days in a month.

TryParse ( string s, DurationType durationType, XsdDuration &result ) : Exception
TryParse ( string s, XsdDuration &result ) : Exception
TryParseDigits ( string s, int &offset, bool eatDigits, int &result, int &numDigits ) : string
TryToTimeSpan ( DurationType durationType, System.TimeSpan &result ) : Exception
TryToTimeSpan ( System.TimeSpan &result ) : Exception
XsdDuration ( System.TimeSpan timeSpan, DurationType durationType ) : System

Construct an XsdDuration from a TimeSpan value that represents an xsd:duration, an xdt:dayTimeDuration, or an xdt:yearMonthDuration.

Method Details

Normalize() public méthode

Normalize year-month part and day-time part so that month < 12, hour < 24, minute < 60, and second < 60.
public Normalize ( ) : XsdDuration
Résultat XsdDuration

ToString() public méthode

Return the string representation of this Xsd duration.
public ToString ( ) : string
Résultat string

ToTimeSpan() public méthode

Internal helper method that converts an Xsd duration to a TimeSpan value. This code uses the estimate that there are 365 days in the year and 30 days in a month.
public ToTimeSpan ( ) : System.TimeSpan
Résultat System.TimeSpan

XsdDuration() public méthode

Construct an XsdDuration from a TimeSpan value.
public XsdDuration ( System.TimeSpan timeSpan ) : System
timeSpan System.TimeSpan
Résultat System

XsdDuration() public méthode

Construct an XsdDuration from component parts.
public XsdDuration ( bool isNegative, int years, int months, int days, int hours, int minutes, int seconds, int nanoseconds ) : System
isNegative bool
years int
months int
days int
hours int
minutes int
seconds int
nanoseconds int
Résultat System

XsdDuration() public méthode

Constructs an XsdDuration from a string in the xsd:duration format. Components are stored with loss of fidelity (except in the case of overflow).
public XsdDuration ( string s ) : System
s string
Résultat System

XsdDuration() public méthode

Constructs an XsdDuration from a string in the xsd:duration format. Components are stored without loss of fidelity (except in the case of overflow).
public XsdDuration ( string s, DurationType durationType ) : System
s string
durationType DurationType
Résultat System