Artemis Artemis
Artemis Artemis

Search Results for

    Class EnumUtilities

    Provides utilities for display enums in a human readable form

    Inheritance
    object
    EnumUtilities
    Namespace: Artemis.Core
    Assembly: Artemis.Core.dll
    Syntax
    public static class EnumUtilities

    Methods

    GetAllValuesAndDescriptions(Type)

    Creates a list containing a tuple for each value in the enum type

    Declaration
    public static List<(Enum, string)> GetAllValuesAndDescriptions(Type t)
    Parameters
    Type Name Description
    Type t

    The enum type to create value descriptions for

    Returns
    Type Description
    List<(Enum, string)>

    A list containing a value-description tuple for each value in the enum type

    GetAllValuesAndDescriptions<T>()

    Creates a list containing a tuple for each value in the enum type

    Declaration
    public static List<(T, string)> GetAllValuesAndDescriptions<T>() where T : struct, Enum
    Returns
    Type Description
    List<(T, string)>

    A list containing a value-description tuple for each value in the enum type

    Type Parameters
    Name Description
    T

    The enum type to create value descriptions for

    HumanizeValue(Enum)

    Humanizes the given enum value using the Humanizer library

    Declaration
    public static string HumanizeValue(Enum value)
    Parameters
    Type Name Description
    Enum value

    The enum value to humanize

    Returns
    Type Description
    string

    A humanized string describing the given value

    Content is available under the PolyForm Noncommercial License, by Artemis RGB.