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: LemonEdge.Utils.dll
Syntax
public class EnumWrapper : IEquatable<EnumWrapper>
Constructors
EnumWrapper()
Declaration
public EnumWrapper()
Properties
DecimalValue
The equivelant value of this EnumValue as a decimal type
Declaration
public decimal DecimalValue { get; set; }
Property Value
| Type | Description |
|---|---|
| decimal |
Label
A user friendly label of this Enum value
Declaration
public string Label { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ObjValue
The actual Enum value being wrapped by this wrapper class
Declaration
public virtual object ObjValue { get; set; }
Property Value
| Type | Description |
|---|---|
| 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 |
|---|---|
| short |
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 |
|---|---|
| string |
Methods
Create(Type, object, short, string, string)
Creates a new EnumWrapper<T> for this enum value
Declaration
public static EnumWrapper Create(Type t, object value, short order, string tooltip, string label)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | t | The type of enum |
| object | value | The value of the enum to be wrapped |
| short | order | The order that enum value appears in the list |
| string | tooltip | An optional user friendly tooltip for this enum value |
| string | label |
Returns
| Type | Description |
|---|---|
| EnumWrapper | A new EnumWrapper<T> for this enum value |
Create<T>(T, short, string, string)
Creates a new EnumWrapper<T> for this enum value
Declaration
public static EnumWrapper<T> Create<T>(T value, short order, string tooltip, string label)
Parameters
| Type | Name | Description |
|---|---|---|
| T | value | The value of the enum to be wrapped |
| short | order | The order that enum value appears in the list |
| string | tooltip | An optional user friendly tooltip for this enum value |
| string | label |
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 |
|---|---|
| bool |
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |