Duration.Compare(Duration, Duration) 方法

定義

將一個 Duration 值與另一個值比較。

public:
 static int Compare(System::Windows::Duration t1, System::Windows::Duration t2);
public static int Compare (System.Windows.Duration t1, System.Windows.Duration t2);
static member Compare : System.Windows.Duration * System.Windows.Duration -> int
Public Shared Function Compare (t1 As Duration, t2 As Duration) As Integer

參數

t1
Duration

要比較的第一個 Duration 執行個體。

t2
Duration

要比較的第二個 Duration 執行個體。

傳回

Int32

如果 t1 小於 t2,則為表示差異的負值。 如果 t1 等於 t2,則為零。 如果 t1 大於 t2,則為表示差異的正值。

備註

Duration 具有 屬性值 Automatic 的實例是具有下列傳回值的特殊案例。

  • 如果 t1 為 Automatic 且 t2 不是 ,則會傳回 -1。

  • 如果 t1 為 Automatic 且 t2 也是 Automatic,則會傳回 0。

  • 如果 t1 不是自動且 t2 為自動,則會傳回 1。

適用於