Duration Duration Duration Duration Struct

Definition

Represents the duration of time that a Timeline is active.

public value class Duration
[System.ComponentModel.TypeConverter(typeof(System.Windows.DurationConverter))]
public struct Duration
type Duration = struct
Public Structure Duration
Inheritance
Attributes

Remarks

XAML Attribute Usage

<object property="[days.]hours:minutes:seconds[.fractionalSeconds]"/>

- or -

<object property="[days.]hours:minutes"/>

- or -

<object property="Automatic"/>

- or -

<object property="Forever"/>

XAML Values

days
System.Int32

A value greater than or equal to 0 that describes the number of days spanned by this duration.

hours
System.Int32

A value between 0 and 23 that represents the number of hours spanned by this duration.

minutes
System.Int32

A value between 0 and 59 that represents the number of minutes spanned by this duration.

seconds
System.Int32

A value between 0 and 59 that represents the number of seconds spanned by this duration

fractionalSeconds
System.Int32

A value consisting of 1 to 7 digits that represents fractional seconds.

Constructors

Duration(TimeSpan) Duration(TimeSpan) Duration(TimeSpan) Duration(TimeSpan)

Initializes a new instance of the Duration structure with the supplied TimeSpan value.

Properties

Automatic Automatic Automatic Automatic

Gets a Duration value that is automatically determined.

Forever Forever Forever Forever

Gets a Duration value that represents an infinite interval.

HasTimeSpan HasTimeSpan HasTimeSpan HasTimeSpan

Gets a value that indicates if this Duration represents a TimeSpan value.

TimeSpan TimeSpan TimeSpan TimeSpan

Gets the TimeSpan value that this Duration represents.

Methods

Add(Duration) Add(Duration) Add(Duration) Add(Duration)

Adds the value of the specified instance of Duration to the value of the current instance.

Compare(Duration, Duration) Compare(Duration, Duration) Compare(Duration, Duration) Compare(Duration, Duration)

Compares one Duration value to another.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether a specified object is equal to an instance of Duration.

Equals(Duration) Equals(Duration) Equals(Duration) Equals(Duration)

Determines whether a specified Duration is equal to this instance of Duration.

Equals(Duration, Duration) Equals(Duration, Duration) Equals(Duration, Duration) Equals(Duration, Duration)

Determines whether two instances of Duration are equal.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Gets a hash code for this instance.

Plus(Duration) Plus(Duration) Plus(Duration) Plus(Duration)

Returns the specified instance of Duration.

Subtract(Duration) Subtract(Duration) Subtract(Duration) Subtract(Duration)

Subtracts the value of the specified instance of Duration from this instance.

ToString() ToString() ToString() ToString()

Converts an instance of Duration to a String representation.

Operators

Addition(Duration, Duration) Addition(Duration, Duration) Addition(Duration, Duration) Addition(Duration, Duration)

Adds two instances of Duration together.

Equality(Duration, Duration) Equality(Duration, Duration) Equality(Duration, Duration) Equality(Duration, Duration)

Determines whether two instances of Duration are equal.

GreaterThan(Duration, Duration) GreaterThan(Duration, Duration) GreaterThan(Duration, Duration) GreaterThan(Duration, Duration)

Determines if one instance of Duration is greater than another.

GreaterThanOrEqual(Duration, Duration) GreaterThanOrEqual(Duration, Duration) GreaterThanOrEqual(Duration, Duration) GreaterThanOrEqual(Duration, Duration)

Determines whether an instance of Duration is greater than or equal to another instance.

Implicit(TimeSpan to Duration) Implicit(TimeSpan to Duration) Implicit(TimeSpan to Duration) Implicit(TimeSpan to Duration)

Implicitly creates a Duration from a given TimeSpan.

Inequality(Duration, Duration) Inequality(Duration, Duration) Inequality(Duration, Duration) Inequality(Duration, Duration)

Determines if two instances of Duration are not equal.

LessThan(Duration, Duration) LessThan(Duration, Duration) LessThan(Duration, Duration) LessThan(Duration, Duration)

Determines if the value of one instance of Duration is less than the value of another instance.

LessThanOrEqual(Duration, Duration) LessThanOrEqual(Duration, Duration) LessThanOrEqual(Duration, Duration) LessThanOrEqual(Duration, Duration)

Determines if the value of one instance of Duration is less than or equal to the value of another instance.

Subtraction(Duration, Duration) Subtraction(Duration, Duration) Subtraction(Duration, Duration) Subtraction(Duration, Duration)

Subtracts the value of one instance of Duration from another.

UnaryPlus(Duration) UnaryPlus(Duration) UnaryPlus(Duration) UnaryPlus(Duration)

Returns the specified instance of Duration.

Applies to