Class Enumeration
Assembly: Code.Library.dll
Syntax
public abstract class Enumeration : IComparable
Constructors
|
Improve this Doc
View Source
Enumeration(int, string)
Declaration
protected Enumeration(int id, string name)
Parameters
Properties
|
Improve this Doc
View Source
Id
Declaration
Property Value
|
Improve this Doc
View Source
Name
Declaration
public string Name { get; }
Property Value
Methods
|
Improve this Doc
View Source
AbsoluteDifference(Enumeration, Enumeration)
Declaration
public static int AbsoluteDifference(Enumeration firstValue, Enumeration secondValue)
Parameters
Returns
|
Improve this Doc
View Source
CompareTo(object)
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.
Declaration
public int CompareTo(object other)
Parameters
Type |
Name |
Description |
object |
other |
|
Returns
Type |
Description |
int |
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value
Meaning
Less than zero
This instance precedes obj in the sort order.
Zero
This instance occurs in the same position in the sort order as obj .
Greater than zero
This instance follows obj in the sort order.
|
Exceptions
|
Improve this Doc
View Source
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
object |
obj |
The object to compare with the current object.
|
Returns
Type |
Description |
bool |
true if the specified object is equal to the current object; otherwise, false.
|
Overrides
|
Improve this Doc
View Source
FromDisplayName<T>(string)
Declaration
public static T FromDisplayName<T>(string displayName) where T : Enumeration
Parameters
Type |
Name |
Description |
string |
displayName |
|
Returns
Type Parameters
|
Improve this Doc
View Source
FromValue<T>(int)
Declaration
public static T FromValue<T>(int value) where T : Enumeration
Parameters
Type |
Name |
Description |
int |
value |
|
Returns
Type Parameters
|
Improve this Doc
View Source
GetAll<T>()
Declaration
public static IEnumerable<T> GetAll<T>() where T : Enumeration
Returns
Type Parameters
|
Improve this Doc
View Source
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type |
Description |
int |
A hash code for the current object.
|
Overrides
|
Improve this Doc
View Source
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type |
Description |
string |
A string that represents the current object.
|
Overrides
Implements
Extension Methods