Duration.Compare(Duration, Duration) 方法

定义

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

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

参数

t1
Duration

要比较的 Duration 的第一个实例。The first instance of Duration to compare.

t2
Duration

要比较的 Duration 的第二个实例。The second instance of Duration to compare.

返回

Int32

如果 t1 小于 t2,则为一个表示差的负值。If t1 is less than t2, a negative value that represents the difference. 如果 t1 等于 t2,则为值 0。If t1 is equal to t2, a value of 0. 如果 t1 大于 t2,则为一个表示差的正值。If t1 is greater than t2, a positive value that represents the difference.

注解

此结构表示 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.

适用于