Show / Hide Table of Contents

Struct Duration

Implements structure for animation duration

Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: EmptyKeys.UserInterface
Assembly: EmptyKeys.UserInterface.dll
Syntax
public struct Duration

Constructors

Duration(TimeSpan)

Initializes a new instance of the Duration structure.

Declaration
public Duration(TimeSpan timeSpan)
Parameters
Type Name Description
System.TimeSpan timeSpan

The time span.

Exceptions
Type Condition
System.ArgumentException

timeSpan

Properties

Automatic

Gets the automatic duration

Declaration
public static Duration Automatic { get; }
Property Value
Type Description
Duration

The automatic duration

Forever

Gets the forever duration

Declaration
public static Duration Forever { get; }
Property Value
Type Description
Duration

The forever duration

HasTimeSpan

Gets a value indicating whether this instance has time span.

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

true if this instance has time span; otherwise, false.

TimeSpan

Gets the time span.

Declaration
public TimeSpan TimeSpan { get; }
Property Value
Type Description
System.TimeSpan

The time span.

Exceptions
Type Condition
System.InvalidOperationException

This duration does not have TimeSpan

Methods

Add(Duration)

Adds the specified duration.

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

The duration.

Returns
Type Description
Duration

Compare(Duration, Duration)

Compares the specified t1 duration to t2

Declaration
public static int Compare(Duration t1, Duration t2)
Parameters
Type Name Description
Duration t1

The t1.

Duration t2

The t2.

Returns
Type Description
System.Int32

Equals(Duration)

Tests if this instance is equal to the specified duration.

Declaration
public bool Equals(Duration duration)
Parameters
Type Name Description
Duration duration

The duration.

Returns
Type Description
System.Boolean

Equals(Duration, Duration)

Tests if the specified t1 duration is equal to t2 duration

Declaration
public static bool Equals(Duration t1, Duration t2)
Parameters
Type Name Description
Duration t1

The t1.

Duration t2

The t2.

Returns
Type Description
System.Boolean

Equals(Object)

Tests if this instance is equal to the specified value.

Declaration
public override bool Equals(object value)
Parameters
Type Name Description
System.Object value

The value.

Returns
Type Description
System.Boolean
Overrides
System.ValueType.Equals(System.Object)

GetHashCode()

Returns a hash code for this instance.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

Overrides
System.ValueType.GetHashCode()

Subtract(Duration)

Subtracts the specified duration.

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

The duration.

Returns
Type Description
Duration

ToString()

Returns a System.String that represents this instance.

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

A System.String that represents this instance.

Overrides
System.ValueType.ToString()

Operators

Addition(Duration, Duration)

Implements the operator +.

Declaration
public static Duration operator +(Duration t1, Duration t2)
Parameters
Type Name Description
Duration t1

The t1.

Duration t2

The t2.

Returns
Type Description
Duration

The result of the operator.

Equality(Duration, Duration)

Implements the operator ==.

Declaration
public static bool operator ==(Duration t1, Duration t2)
Parameters
Type Name Description
Duration t1

The t1.

Duration t2

The t2.

Returns
Type Description
System.Boolean

The result of the operator.

GreaterThan(Duration, Duration)

Implements the operator >.

Declaration
public static bool operator>(Duration t1, Duration t2)
Parameters
Type Name Description
Duration t1

The t1.

Duration t2

The t2.

Returns
Type Description
System.Boolean

The result of the operator.

GreaterThanOrEqual(Duration, Duration)

Implements the operator >=.

Declaration
public static bool operator >=(Duration t1, Duration t2)
Parameters
Type Name Description
Duration t1

The t1.

Duration t2

The t2.

Returns
Type Description
System.Boolean

The result of the operator.

Implicit(TimeSpan to Duration)

Performs an implicit conversion from TimeSpan to Duration.

Declaration
public static implicit operator Duration(TimeSpan timeSpan)
Parameters
Type Name Description
System.TimeSpan timeSpan

The time span.

Returns
Type Description
Duration

The result of the conversion.

Exceptions
Type Condition
System.ArgumentException

timeSpan

Inequality(Duration, Duration)

Implements the operator !=.

Declaration
public static bool operator !=(Duration t1, Duration t2)
Parameters
Type Name Description
Duration t1

The t1.

Duration t2

The t2.

Returns
Type Description
System.Boolean

The result of the operator.

LessThan(Duration, Duration)

Implements the operator <.

Declaration
public static bool operator <(Duration t1, Duration t2)
Parameters
Type Name Description
Duration t1

The t1.

Duration t2

The t2.

Returns
Type Description
System.Boolean

The result of the operator.

LessThanOrEqual(Duration, Duration)

Implements the operator <=.

Declaration
public static bool operator <=(Duration t1, Duration t2)
Parameters
Type Name Description
Duration t1

The t1.

Duration t2

The t2.

Returns
Type Description
System.Boolean

The result of the operator.

Subtraction(Duration, Duration)

Implements the operator -.

Declaration
public static Duration operator -(Duration t1, Duration t2)
Parameters
Type Name Description
Duration t1

The t1.

Duration t2

The t2.

Returns
Type Description
Duration

The result of the operator.

UnaryPlus(Duration)

Implements the operator +.

Declaration
public static Duration operator +(Duration duration)
Parameters
Type Name Description
Duration duration

The duration.

Returns
Type Description
Duration

The result of the operator.

Back to top Generated by DocFX