Show / Hide Table of Contents

Class Duration

Represents the XML schema duration type.

Inheritance
System.Object
Duration
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.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(Boolean, Int32, Int32, Int32, Int32, Int32, 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
System.Boolean negative

true if the duration is negative; otherwise false.

System.Int32 years

The number of years.

System.Int32 months

The number of months.

System.Int32 days

The number of days.

System.Int32 hours

The number of hours.

System.Int32 minutes

The number of minutes.

System.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
System.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
System.Int32

The number of days.

Hours

Gets or sets the number of hours.

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

The number of hours.

Minutes

Gets or sets the number of minutes.

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

The number of minutes.

Months

Gets or sets the number of months.

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

The number of months.

Negative

Gets or sets the negative duration flag.

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

The negative duration flag.

Seconds

Gets or sets the number of seconds.

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

The number of seconds.

Years

Gets or sets the number of years.

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

The number of years.

Methods

ToString()

Returns a string that represents the duration.

Declaration
public override string ToString()
Returns
Type Description
System.String

A string that represents the duration.

Overrides
System.Object.ToString()
Remarks

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

In This Article
Back to top Copyright © ComponentSpace Pty Ltd 2004-2022. All rights reserved.