MSDN Documentation

System.Enum Members

This page lists and describes the members of the System.Enum class in the .NET Framework.

Public Methods

CompareTo

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(object value);
Equals

Determines whether the specified object is equal to the current instance.

public override bool Equals(object obj);
GetHashCode

Returns the hash code for this instance.

public override int GetHashCode();
GetName

Returns the name of the named numeric value of an enumeration constant.

public static string GetName(Type enumType, object value);
GetNames

Returns an array of the names of the members of a specified enumeration type.

public static string[] GetNames(Type enumType);
GetTypeCode

Returns the TypeCode for the current instance.

public TypeCode GetTypeCode();
GetValue

Returns the underlying integral value of the specified enumeration constant.

public static object GetValue(Type enumType, string name);
GetValues

Returns an array of the values of the members of a specified enumeration type.

public static Array GetValues(Type enumType);
IsDefined

Determines whether a specified value is defined for a specified enumeration type.

public static bool IsDefined(Type enumType, object value);
Parse

Converts the specified string representation of a name or numeric value to an enumeration object.

public static object Parse(Type enumType, string value);
public static object Parse(Type enumType, string value, bool ignoreCase);
ToString

Converts the value of this instance to its equivalent string representation.

public override string ToString();
public static string ToString(Type enumType, object value);
TryGetName

Attempts to get the name of the enumerated constant with the specified value.

public static bool TryGetName(Type enumType, object value, out string name);
TryGetValue

Attempts to get the enumerated constant with the specified name.

public static bool TryGetValue(Type enumType, string name, out object value);
public static bool TryGetValue(Type enumType, string name, bool ignoreCase, out object value);