Name
Enum
Synopsis
This is the base class for all
enumerations. In C#, you can use the
enum
keyword to create an enumeration type
consisting of named constants and their values. By default, the
underlying type used for enumeration elements is
Int32
, but you can use any integer data type.
public abstract class Enum : ValueType : IComparable, IFormattable, IConvertible { // Protected Constructors protected Enum( ); // Public Static Methods public static string Format(TypeenumType
, objectvalue
, stringformat
); public static string GetName(TypeenumType
, objectvalue
); public static string[ ] GetNames(TypeenumType
); public static Type GetUnderlyingType(TypeenumType
); public static Array GetValues(TypeenumType
); public static bool IsDefined(TypeenumType
, objectvalue
); public static object Parse(TypeenumType
, stringvalue
); public static object Parse(TypeenumType
, stringvalue
, boolignoreCase
); public static object ToObject(TypeenumType
, bytevalue
); public static object ToObject(TypeenumType
, shortvalue
); public static object ToObject(TypeenumType
, intvalue
); public static object ToObject(TypeenumType
, longvalue
); public static object ToObject(TypeenumType
, objectvalue
); public static object ToObject(TypeenumType
, sbytevalue
); public static object ToObject(TypeenumType
, ushortvalue
); public static object ToObject(TypeenumType
, uintvalue
); public static object ToObject(TypeenumType
, ulongvalue
); // Public Instance Methods public int CompareTo(objecttarget
); ...
Get C# in a Nutshell, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.