EnumValueNameSortComparer Class
Sorts enumeration values by name, in ascending order.
public class EnumValueNameSortComparer
- Inheritance:
- object object
Constructors
EnumValueNameSortComparer()
Initializes an instance of the class.
public EnumValueNameSortComparer()
Properties
Instance
Gets a global instance of this comparer.
public static EnumValueNameSortComparer Instance { get; }
Property Value
- EnumValueNameSortComparer:
A global instance of this comparer.
Methods
Compare(Enum, Enum)
Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.
public int Compare(Enum x, Enum y)
Parameter | Type | Description |
---|---|---|
x | Enum | The first object to compare. |
y | Enum | The second object to compare. |
Returns
- int:
Value Condition Less than zero -
x
is less thany
. Zero -x
equalsy
. Greater than zero -x
is greater thany
.