Duration Duration Duration Duration Struct

定義

表示 Timeline 作用中的持續時間。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
繼承
屬性

備註

XAML Attribute UsageXAML Attribute Usage

<物件**屬性= "[]。小時:分鐘:[。fractionalSeconds] "/><object property="[days.]hours:minutes:seconds[.fractionalSeconds]"/>

-或--or-

<物件**屬性= "[]。小時:分鐘"/><object property="[days.]hours:minutes"/>

-或--or-

<object property="Automatic"/><object property="Automatic"/>

-或--or-

<object property="Forever"/><object property="Forever"/>

XAML 值XAML Values

之內days
System.Int32

大於或等於0的值, 描述此持續時間所跨越的天數。A value greater than or equal to 0 that describes the number of days spanned by this duration.

多少hours
System.Int32

介於0和23之間的值, 表示此持續時間所跨越的時數。A value between 0 and 23 that represents the number of hours spanned by this duration.

細節minutes
System.Int32

介於0和59之間的值, 表示此持續時間所跨越的分鐘數。A value between 0 and 59 that represents the number of minutes spanned by this duration.

表示seconds
System.Int32

介於0和59之間的值, 表示此持續時間所跨越的秒數。A value between 0 and 59 that represents the number of seconds spanned by this duration

fractionalSecondsfractionalSeconds
System.Int32

包含1到7位數的值, 代表小數秒數。A value consisting of 1 to 7 digits that represents fractional seconds.

建構函式

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

使用提供的 Duration 值,初始化 TimeSpan 結構的新執行個體 (Instance)。Initializes a new instance of the Duration structure with the supplied TimeSpan value.

屬性

Automatic Automatic Automatic Automatic

取得自動決定的 Duration 值。Gets a Duration value that is automatically determined.

Forever Forever Forever Forever

取得表示無限間隔的 Duration 值。Gets a Duration value that represents an infinite interval.

HasTimeSpan HasTimeSpan HasTimeSpan HasTimeSpan

取得值,這個值指出這個 Duration 是否表示 TimeSpan 值。Gets a value that indicates if this Duration represents a TimeSpan value.

TimeSpan TimeSpan TimeSpan TimeSpan

取得這個 Duration 所代表的 TimeSpan 值。Gets the TimeSpan value that this Duration represents.

方法

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

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)

將一個 Duration 值與另一個值比較。Compares one Duration value to another.

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

判斷指定的物件是否等於 Duration 的執行個體。Determines whether a specified object is equal to an instance of Duration.

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

判斷指定的 Duration 是否等於 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)

判斷 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)

傳回 Duration 的指定執行個體。Returns the specified instance of Duration.

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

從這個執行個體中減去 Duration 之指定執行個體的值。Subtracts the value of the specified instance of Duration from this instance.

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

Duration 的執行個體轉換成 String 表示。Converts an instance of Duration to a String representation.

運算子

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

同時加入 Duration 的兩個執行個體。Adds two instances of Duration together.

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

判斷 Duration 的兩個執行個體是否相等。Determines whether two instances of Duration are equal.

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

判斷 Duration 的一個執行個體是否大於另一個執行個體。Determines if one instance of Duration is greater than another.

GreaterThanOrEqual(Duration, Duration) GreaterThanOrEqual(Duration, Duration) GreaterThanOrEqual(Duration, Duration) GreaterThanOrEqual(Duration, 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)

從指定的 Duration 隱含地建立 TimeSpanImplicitly creates a Duration from a given TimeSpan.

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

判斷 Duration 的兩個執行個體是否不相等。Determines if two instances of Duration are not equal.

LessThan(Duration, Duration) LessThan(Duration, Duration) LessThan(Duration, Duration) LessThan(Duration, 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)

判斷 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)

Duration 的一個執行個體值減去另一個執行個體值。Subtracts the value of one instance of Duration from another.

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

傳回 Duration 的指定執行個體。Returns the specified instance of Duration.

適用於

另請參閱