Search Results for

    Show / Hide Table of Contents

    Class EnumWrapper

    A wrapper for providing details about an enum value including a description for use with user selection of values

    Inheritance
    object
    EnumWrapper
    EnumWrapper<T>
    Implements
    IEquatable<EnumWrapper>
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    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
    object.Equals(object)

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    object.GetHashCode()

    Implements

    IEquatable<T>

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)

    See Also

    EnumWrapper<T>
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.