C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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).

Приватные методы

Метод Описание
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.

Описание методов

Normalize() публичный Метод

Normalize year-month part and day-time part so that month < 12, hour < 24, minute < 60, and second < 60.
public Normalize ( ) : XsdDuration
Результат XsdDuration

ToString() публичный Метод

Return the string representation of this Xsd duration.
public ToString ( ) : string
Результат string

ToTimeSpan() публичный Метод

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
Результат System.TimeSpan

XsdDuration() публичный Метод

Construct an XsdDuration from a TimeSpan value.
public XsdDuration ( System.TimeSpan timeSpan ) : System
timeSpan System.TimeSpan
Результат System

XsdDuration() публичный Метод

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
Результат System

XsdDuration() публичный Метод

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
Результат System

XsdDuration() публичный Метод

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
Результат System