Duration 结构

定义

表示 Timeline 处于活动状态的持续时间。Represents the duration of time that a Timeline is active.

public value class Duration
public struct Duration
[System.Security.SecurityCritical]
public struct Duration
type Duration = struct
[<System.Security.SecurityCritical>]
type Duration = struct
Public Structure Duration
继承
Duration
属性

注解

此结构表示 Windows 运行时 (WinRT) 结构的 .NET 投影 DurationThis struct represents the .NET projection of the Windows Runtime (WinRT) Duration struct. 有关详细信息,请参阅 UWP API 参考中的 持续时间For more information, see Duration in the UWP API reference.

构造函数

Duration(TimeSpan)

使用指定的 TimeSpan 值初始化 Duration 结构的新实例。Initializes a new instance of the Duration struct with the specified TimeSpan value.

属性

Automatic

获取自动确定的 Duration 值。Gets a Duration value that is automatically determined.

Forever

获取表示无限间隔的 Duration 值。Gets a Duration value that represents an infinite interval.

HasTimeSpan

获取一个值,该值指示此 Duration 是否表示 TimeSpan 值。Gets a value that indicates if this Duration represents a TimeSpan value.

TimeSpan

获取此 Duration 表示的 TimeSpan 值。Gets the TimeSpan value that this Duration represents.

方法

Add(Duration)

将指定的 Duration 的值添加到 DurationAdds the value of the specified Duration to this Duration.

Compare(Duration, Duration)

将一个 Duration 值与另一个值进行比较。Compares one Duration value to another.

Equals(Duration)

确定指定的 Duration 是否等于此 DurationDetermines whether a specified Duration is equal to this Duration.

Equals(Duration, Duration)

确定两个 Duration 值是否相等。Determines whether two Duration values are equal.

Equals(Object)

确定指定的对象是否等于 DurationDetermines whether a specified object is equal to a Duration.

GetHashCode()

获取此对象的哈希代码。Gets a hash code for this object.

Subtract(Duration)

从此 Duration 中减去指定的 DurationSubtracts the specified Duration from this Duration.

ToString()

Duration 转换为 String 表示形式。Converts a Duration to a String representation.

运算符

Addition(Duration, Duration)

将两个 Duration 值相加。Adds two Duration values together.

Equality(Duration, Duration)

确定两个 Duration 案例是否相等。Determines whether two Duration cases are equal.

GreaterThan(Duration, Duration)

确定两个 Duration 是否一大一小。Determines if one Duration is greater than another.

GreaterThanOrEqual(Duration, Duration)

确定其中一个 Duration 是否大于或等于另一个。Determines whether a Duration is greater than or equal to another.

Implicit(TimeSpan to Duration)

依据给定的 Duration 隐式创建 TimeSpanImplicitly creates a Duration from a given TimeSpan.

Inequality(Duration, Duration)

确定两个 Duration 案例不相等。Determines if two Duration cases are not equal.

LessThan(Duration, Duration)

确定 Duration 是否小于另一个实例的值。Determines if a Duration is less than the value of another instance.

LessThanOrEqual(Duration, Duration)

确定 Duration 是否小于或等于另一个。Determines if a Duration is less than or equal to another.

Subtraction(Duration, Duration)

从另一个值中减去 Duration 的值。Subtracts the value of one Duration from another.

UnaryPlus(Duration)

返回指定的 DurationReturns the specified Duration.

适用于