Table of Contents

Method SafeCompareTo

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

SafeCompareTo(object, object)

Same as CompareTo(object) but additionally allows to compare different integer types without exceptions. Objects must support IComparable interface.

public static int SafeCompareTo(object a, object b)

Parameters

a object

The first of two objects to compare.

b object

The second of two objects to compare.

Returns

int

A value that indicates the relative order of the objects being compared. Meanings: Result is less than zero – a precedes b in the sort order. Result is zero – a occurs in the same position in the sort order as b. Result is greater than zero – a follows b in the sort order.