Returns a value indicating whether this instance is equal to a specified object.
Assembly: mscorlib (in mscorlib.dll)
- Type: System.Object
An object to compare with this instance, or a null reference (Nothing in Visual Basic).
Return ValueType: System.Boolean
true if obj is an enumeration value of the same type and with the same underlying value as this instance; otherwise, false.
The method overrides ValueType.Equals(Object) to define how enumeration members are evaluated for equality.
The following example illustrates the use of the method.
The following example defines two enumeration types, SledDog and WorkDog. The SledDog enumeration has two members, SledDog.AlaskanMalamute and SledDog.Malamute, that have the same underlying value. The call to the method indicates that these values are equal because their underlying values are the same. The SledDog.Malamute and WorkDog.Newfoundland members have the same underlying value, although they represent different enumeration types. A call to the method indicates that these values are not equal.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.