Search Results for

    Show / Hide Table of Contents

    Class EnumExtensions

    Inheritance
    object
    EnumExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9
    Assembly: Glitch9.dll
    Syntax
    public static class EnumExtensions

    Methods

    | Edit this page View Source

    HasAnyFlag<T>(T, T?)

    Checks if the enum value has any of the specified flags set. If the flag parameter is null, returns false.

    Declaration
    public static bool HasAnyFlag<T>(this T value, T? flag) where T : struct, Enum
    Parameters
    Type Name Description
    T value
    T? flag
    Returns
    Type Description
    bool
    Type Parameters
    Name Description
    T
    | Edit this page View Source

    ToEnum<TEnum>(int)

    Declaration
    public static TEnum ToEnum<TEnum>(this int value) where TEnum : struct, Enum
    Parameters
    Type Name Description
    int value
    Returns
    Type Description
    TEnum
    Type Parameters
    Name Description
    TEnum
    | Edit this page View Source

    ToFlagList<T>(T)

    Declaration
    public static List<T> ToFlagList<T>(this T value) where T : struct, Enum
    Parameters
    Type Name Description
    T value
    Returns
    Type Description
    List<T>
    Type Parameters
    Name Description
    T
    | Edit this page View Source

    ToFlagSet<T>(T)

    Declaration
    public static HashSet<T> ToFlagSet<T>(this T value) where T : struct, Enum
    Parameters
    Type Name Description
    T value
    Returns
    Type Description
    HashSet<T>
    Type Parameters
    Name Description
    T
    | Edit this page View Source

    ToJoinedString<T>(T, char, char)

    Formats a [Flags] enum value to a lowercase joined string. If the value is the default (zero) value, returns an empty string.

    Declaration
    public static string ToJoinedString<T>(this T value, char splitSeparator = ',', char joinSeparator = '-') where T : struct, Enum
    Parameters
    Type Name Description
    T value
    char splitSeparator
    char joinSeparator
    Returns
    Type Description
    string
    Type Parameters
    Name Description
    T
    | Edit this page View Source

    ToLowerInvariantString<T>(T)

    Formats an enum value to a lowercase string. If the value is the default (zero) value, returns an empty string.

    Declaration
    public static string ToLowerInvariantString<T>(this T value) where T : struct, Enum
    Parameters
    Type Name Description
    T value
    Returns
    Type Description
    string
    Type Parameters
    Name Description
    T
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation