Duration.Compare Method

Compares one Duration value to another.

Namespace: System.Windows
Assembly: PresentationCore (in presentationcore.dll)

public static int Compare (
	Duration t1,
	Duration t2
)
public static int Compare (
	Duration t1, 
	Duration t2
)
public static function Compare (
	t1 : Duration, 
	t2 : Duration
) : int
You cannot use methods in XAML.

Parameters

t1

The first instance of Duration to compare.

t2

The second instance of Duration to compare.

Return Value

If t1 is less than t2, a negative value that represents the difference. If t1 is equal to t2, zero. If t1 is greater than t2, a positive value that represents the difference.

Duration instances with a property value of Automatic are a special case with the following return values.

  • If t1 is Automatic and t2 is not, -1 is returned.

  • If t1 is Automatic and t2 is also Automatic, 0 is returned.

  • If t1 is not Automatic and t2 is Automatic, 1 is returned.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Show: