# Duration.Compare(Duration, Duration)Duration.Compare(Duration, Duration)Duration.Compare(Duration, Duration)Duration.Compare(Duration, Duration) Method

## 定義

``````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 Duration Duration

t2
Duration Duration Duration Duration

#### 戻り値

`t1``t2` より小さい場合は、その差を表す負の値です。If `t1` is less than `t2`, a negative value that represents the difference. `t1``t2` に等しい場合は、0 です。If `t1` is equal to `t2`, zero. `t1``t2` より大きい場合は、その差を表す正の値です。If `t1` is greater than `t2`, a positive value that represents the difference.

## 注釈

Duration インスタンスのプロパティ値を持つAutomaticは次の戻り値を持つ特殊なケースです。Duration instances with a property value of Automatic are a special case with the following return values.

• 場合`t1`自動と`t2`は、-1 が返されます。If `t1` is Automatic and `t2` is not, -1 is returned.

• 場合`t1`自動と`t2`は自動にも 0 が返されます。If `t1` is Automatic and `t2` is also Automatic, 0 is returned.

• 場合`t1`自動でないと`t2`自動、1 が返されます。If `t1` is not Automatic and `t2` is Automatic, 1 is returned.