Show / Hide Table of Contents

Class Duration

Represents the XML schema duration type.

Inheritance
object
Duration
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: ComponentSpace.SAML2.Metadata
Assembly: ComponentSpace.Saml2.dll
Syntax
public class Duration
Remarks

Refer to the XML Schema specification for further details.

Constructors

Duration()

Initializes a new instance of the Duration class.

Declaration
public Duration()

Duration(bool, int, int, int, int, int, decimal)

Initializes a new instance of the Duration class.

Declaration
public Duration(bool negative, int years, int months, int days, int hours, int minutes, decimal seconds)
Parameters
Type Name Description
bool negative

true if the duration is negative; otherwise false.

int years

The number of years.

int months

The number of months.

int days

The number of days.

int hours

The number of hours.

int minutes

The number of minutes.

decimal seconds

The number of seconds.

Duration(string)

Initializes a new instance of the Duration class.

Declaration
public Duration(string duration)
Parameters
Type Name Description
string duration

The duration as a string.

Remarks

The format of the string is: [-]PnYnMnDTnHnMnS.

Exceptions
Type Condition
SAMLSerializationException

Thrown when the string format is invalid.

Properties

Days

Gets or sets the number of days.

Declaration
public int Days { get; set; }
Property Value
Type Description
int

The number of days.

Hours

Gets or sets the number of hours.

Declaration
public int Hours { get; set; }
Property Value
Type Description
int

The number of hours.

Minutes

Gets or sets the number of minutes.

Declaration
public int Minutes { get; set; }
Property Value
Type Description
int

The number of minutes.

Months

Gets or sets the number of months.

Declaration
public int Months { get; set; }
Property Value
Type Description
int

The number of months.

Negative

Gets or sets the negative duration flag.

Declaration
public bool Negative { get; set; }
Property Value
Type Description
bool

The negative duration flag.

Seconds

Gets or sets the number of seconds.

Declaration
public decimal Seconds { get; set; }
Property Value
Type Description
decimal

The number of seconds.

Years

Gets or sets the number of years.

Declaration
public int Years { get; set; }
Property Value
Type Description
int

The number of years.

Methods

ToString()

Returns a string that represents the duration.

Declaration
public override string ToString()
Returns
Type Description
string

A string that represents the duration.

Overrides
object.ToString()
Remarks

The format of the string is: [-]PnYnMnDTnHnMnS.

In this article
Back to top Copyright © ComponentSpace Pty Ltd 2004-2025. All rights reserved.