Class EnumWrapper
A wrapper for providing details about an enum value including a description for use with user selection of values
Implements
Inherited Members
Namespace: LemonEdge.Utils
Assembly: Utils.dll
Syntax
public class EnumWrapper : IEquatable<EnumWrapper>
Properties
DecimalValue
The equivelant value of this EnumValue as a decimal type
Declaration
public decimal DecimalValue { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Decimal |
Label
A user friendly label of this Enum value
Declaration
public string Label { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
ObjValue
The actual Enum value being wrapped by this wrapper class
Declaration
public virtual object ObjValue { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object |
Order
The order this enum value appears in the enum itself for ordering the result set
Declaration
public short Order { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int16 |
Tooltip
A tooltip for this enum, dynamically retrieved from DescriptionAttribute marked against the enum value itself
Declaration
public string Tooltip { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
Create(Type, Object, Int16, String)
Creates a new EnumWrapper<T> for this enum value
Declaration
public static EnumWrapper Create(Type t, object value, short order, string tooltip)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | t | The type of enum |
| System.Object | value | The value of the enum to be wrapped |
| System.Int16 | order | The order that enum value appears in the list |
| System.String | tooltip | An optional user friendly tooltip for this enum value |
Returns
| Type | Description |
|---|---|
| EnumWrapper | A new EnumWrapper<T> for this enum value |
Create<T>(T, Int16, String)
Creates a new EnumWrapper<T> for this enum value
Declaration
public static EnumWrapper<T> Create<T>(T value, short order, string tooltip)
Parameters
| Type | Name | Description |
|---|---|---|
| T | value | The value of the enum to be wrapped |
| System.Int16 | order | The order that enum value appears in the list |
| System.String | tooltip | An optional user friendly tooltip for this enum value |
Returns
| Type | Description |
|---|---|
| EnumWrapper<T> | A new EnumWrapper<T> for this enum value |
Type Parameters
| Name | Description |
|---|---|
| T | The type of enum |
Equals(EnumWrapper)
Declaration
public bool Equals(EnumWrapper other)
Parameters
| Type | Name | Description |
|---|---|---|
| EnumWrapper | other |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 |