Enum.CompareTo Method (Object)
.NET Framework (current version)
Compares this instance to a specified object and returns an indication of their relative values.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- target
-
Type:
System.Object
An object to compare, or null.
Return Value
Type: System.Int32A signed number that indicates the relative values of this instance and target.
Value | Meaning |
|---|---|
Less than zero | The value of this instance is less than the value of target. |
Zero | The value of this instance is equal to the value of target. |
Greater than zero | The value of this instance is greater than the value of target. -or- target is null. |
Implements
IComparable.CompareTo(Object)| Exception | Condition |
|---|---|
| ArgumentException | target and this instance are not the same type. |
| InvalidOperationException |
Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Show: