DurationHelper.Compare(Duration, Duration) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Compares value equality of two Duration structures. C# and Microsoft Visual Basic code should use Duration.Compare instead.
static int Compare(Duration const& duration1, Duration const& duration2);
public static int Compare(Duration duration1, Duration duration2);
function compare(duration1, duration2)
Public Shared Function Compare (duration1 As Duration, duration2 As Duration) As Integer
Parameters
Returns
int
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
Durationinstances with a value of Automatic are a special case with the following return values:
- If
duration1
is Automatic andduration2
is not, -1 is returned. - If
duration1
is Automatic andduration2
is also Automatic, 0 is returned. - If
duration1
is not Automatic andduration2
is Automatic, 1 is returned.