DurationHelper.Compare method

Applies to Windows and Windows Phone

Compares value equality of two Duration structures. C# and Microsoft Visual Basic code should use Compare instead.

Syntax


public:
static int Compare(
  Duration duration1, 
  Duration duration2
)

Parameters

duration1

Type: Duration

The first Duration to compare.

duration2

Type: Duration

The second Duration to compare.

Return value

Type: Int32

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

Remarks

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

  • If duration1 is Automatic and duration2 is not, -1 is returned.
  • If duration1 is Automatic and duration2 is also Automatic, 0 is returned.
  • If duration1 is not Automatic and duration2 is Automatic, 1 is returned.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows::UI::Xaml

Metadata

Windows.winmd

See also

DurationHelper

 

 

Show:
© 2014 Microsoft