C# Класс EnumsNET.NonGeneric.NonGenericFlagEnums

A non-generic implementation of the static class FlagEnums. When the type is known at compile-time the FlagEnums class should be used instead, to provide type safety and to avoid boxing.
Показать файл Открыть проект

Открытые методы

Метод Описание
CombineFlags ( Type enumType ) : object

Combines all of the flags of flags.

CombineFlags ( Type enumType, object value, object otherFlags ) : object

Combines the flags of value and otherFlags. Equivalent to the bitwise "or" operation.

CommonFlags ( Type enumType, object value, object otherFlags ) : object

Returns value with only the flags that are also in otherFlags. Equivalent to the bitwise "and" operation.

FormatFlags ( Type enumType, object value ) : string

Retrieves the names of value's flags delimited with commas or if empty returns the name of the zero flag if defined otherwise "0". If value is not a valid flag combination null is returned.

FormatFlags ( Type enumType, object value, string delimiter ) : string

Retrieves the names of value's flags delimited with delimiter or if empty returns the name of the zero flag if defined otherwise "0". If value is not a valid flag combination null is returned.

GetAllFlags ( Type enumType ) : object

Retrieves all the flags defined by enumType.

GetFlagMembers ( Type enumType, object value ) : IEnumerable

Retrieves the EnumMember{TEnum}s of the flags that compose value.

GetFlagMembers ( this member ) : IEnumerable

Retrieves the EnumMembers of the flags that compose member's value.

GetFlags ( Type enumType, object value ) : IEnumerable

Retrieves the flags that compose value.

GetFlags ( this member ) : IEnumerable

Retrieves the flags that compose member's value.

HasAllFlags ( Type enumType, object value ) : bool

Indicates if value has all of the flags that are defined in enumType.

HasAllFlags ( Type enumType, object value, object otherFlags ) : bool

Indicates if value has all of the flags that are in otherFlags.

HasAnyFlags ( Type enumType, object value ) : bool

Indicates if value has any flags.

HasAnyFlags ( Type enumType, object value, object otherFlags ) : bool

Indicates if value has any flags that are in otherFlags.

IsFlagEnum ( Type enumType ) : bool

Indicates if enumType is marked with the FlagsAttribute.

IsValidFlagCombination ( Type enumType, object value ) : bool

Indicates whether value is a valid flag combination of enumType's defined flags.

ParseFlags ( Type enumType, string value ) : object

Converts the string representation of one or more member names or values of enumType to its respective value of type enumType.

ParseFlags ( Type enumType, string value, bool ignoreCase ) : object

Converts the string representation of one or more member names or values of enumType to its respective value of type enumType. The parameter ignoreCase specifies if the operation is case-insensitive.

ParseFlags ( Type enumType, string value, bool ignoreCase, string delimiter ) : object

Converts the string representation of one or more member names or values of enumType delimited with delimiter to its respective value of type enumType. The parameter ignoreCase specifies if the operation is case-insensitive.

ParseFlags ( Type enumType, string value, string delimiter ) : object

Converts the string representation of one or more member names or values of enumType delimited with delimiter to its respective value of type enumType.

RemoveFlags ( Type enumType, object value, object otherFlags ) : object

Returns value without the flags specified in otherFlags.

ToggleFlags ( Type enumType, object value ) : object

Returns value with all of it's flags toggled. Equivalent to the bitwise "xor" operator with GetAllFlags(Type).

ToggleFlags ( Type enumType, object value, object otherFlags ) : object

Returns value while toggling the flags that are in otherFlags. Equivalent to the bitwise "xor" operator.

TryParseFlags ( Type enumType, string value, bool ignoreCase, object &result ) : bool

Tries to convert the string representation of one or more member names or values of enumType to its respective value of type enumType. The parameter ignoreCase specifies whether the operation is case-insensitive. The return value indicates whether the conversion succeeded.

TryParseFlags ( Type enumType, string value, bool ignoreCase, string delimiter, object &result ) : bool

Tries to convert the string representation of one or more member names or values of enumType delimited with delimiter to its respective value of type enumType. The parameter ignoreCase specifies whether the operation is case-insensitive. The return value indicates whether the conversion succeeded.

TryParseFlags ( Type enumType, string value, object &result ) : bool

Tries to convert the string representation of one or more member names or values of enumType to its respective value of type enumType. The return value indicates whether the conversion succeeded.

TryParseFlags ( Type enumType, string value, string delimiter, object &result ) : bool

Tries to convert the string representation of one or more member names or values of enumType delimited with delimiter to its respective value of type enumType. The return value indicates whether the conversion succeeded.

Описание методов

CombineFlags() публичный статический Метод

Combines all of the flags of flags.
or is null. is not an enum type /// -or- /// contains a value that is of an invalid type.
public static CombineFlags ( Type enumType ) : object
enumType System.Type The enum type.
Результат object

CombineFlags() публичный статический Метод

Combines the flags of value and otherFlags. Equivalent to the bitwise "or" operation.
, , or is null. is not an enum type /// -or- /// or is of an invalid type.
public static CombineFlags ( Type enumType, object value, object otherFlags ) : object
enumType System.Type The enum type.
value object The flags enum value.
otherFlags object The other flags enum value.
Результат object

CommonFlags() публичный статический Метод

Returns value with only the flags that are also in otherFlags. Equivalent to the bitwise "and" operation.
, , or is null. is not an enum type /// -or- /// or is of an invalid type.
public static CommonFlags ( Type enumType, object value, object otherFlags ) : object
enumType System.Type The enum type.
value object The flags enum value.
otherFlags object The other flags enum value.
Результат object

FormatFlags() публичный статический Метод

Retrieves the names of value's flags delimited with commas or if empty returns the name of the zero flag if defined otherwise "0". If value is not a valid flag combination null is returned.
or is null. is not an enum type /// -or- /// is of an invalid type.
public static FormatFlags ( Type enumType, object value ) : string
enumType System.Type The enum type.
value object The flags enum value.
Результат string

FormatFlags() публичный статический Метод

Retrieves the names of value's flags delimited with delimiter or if empty returns the name of the zero flag if defined otherwise "0". If value is not a valid flag combination null is returned.
or is null. is not an enum type /// -or- /// is of an invalid type.
public static FormatFlags ( Type enumType, object value, string delimiter ) : string
enumType System.Type The enum type.
value object The flags enum value.
delimiter string The delimiter to use to separate individual flags.
Результат string

GetAllFlags() публичный статический Метод

Retrieves all the flags defined by enumType.
is null. is not an enum type.
public static GetAllFlags ( Type enumType ) : object
enumType System.Type The enum type.
Результат object

GetFlagMembers() публичный статический Метод

Retrieves the EnumMember{TEnum}s of the flags that compose value.
or is null. is not an enum type /// -or- /// is of an invalid type.
public static GetFlagMembers ( Type enumType, object value ) : IEnumerable
enumType System.Type The enum type.
value object The flags enum value.
Результат IEnumerable

GetFlagMembers() публичный статический Метод

Retrieves the EnumMembers of the flags that compose member's value.
is null.
public static GetFlagMembers ( this member ) : IEnumerable
member this The enum member.
Результат IEnumerable

GetFlags() публичный статический Метод

Retrieves the flags that compose value.
or is null. is not an enum type /// -or- /// is of an invalid type.
public static GetFlags ( Type enumType, object value ) : IEnumerable
enumType Type The enum type.
value object The flags enum value.
Результат IEnumerable

GetFlags() публичный статический Метод

Retrieves the flags that compose member's value.
is null.
public static GetFlags ( this member ) : IEnumerable
member this The enum member.
Результат IEnumerable

HasAllFlags() публичный статический Метод

Indicates if value has all of the flags that are defined in enumType.
or is null. is not an enum type /// -or- /// is of an invalid type.
public static HasAllFlags ( Type enumType, object value ) : bool
enumType Type The enum type.
value object The flags enum value.
Результат bool

HasAllFlags() публичный статический Метод

Indicates if value has all of the flags that are in otherFlags.
, , or is null. is not an enum type /// -or- /// or is of an invalid type.
public static HasAllFlags ( Type enumType, object value, object otherFlags ) : bool
enumType Type The enum type.
value object The flags enum value.
otherFlags object The other flags enum value.
Результат bool

HasAnyFlags() публичный статический Метод

Indicates if value has any flags.
or is null. is not an enum type /// -or- /// is of an invalid type.
public static HasAnyFlags ( Type enumType, object value ) : bool
enumType Type The enum type.
value object The flags enum value.
Результат bool

HasAnyFlags() публичный статический Метод

Indicates if value has any flags that are in otherFlags.
, , or is null. is not an enum type /// -or- /// or is of an invalid type.
public static HasAnyFlags ( Type enumType, object value, object otherFlags ) : bool
enumType Type The enum type.
value object The flags enum value.
otherFlags object The other flags enum value.
Результат bool

IsFlagEnum() публичный статический Метод

Indicates if enumType is marked with the FlagsAttribute.
is null. is not an enum type.
public static IsFlagEnum ( Type enumType ) : bool
enumType Type The enum type.
Результат bool

IsValidFlagCombination() публичный статический Метод

Indicates whether value is a valid flag combination of enumType's defined flags.
or is null. is not an enum type /// -or- /// is of an invalid type.
public static IsValidFlagCombination ( Type enumType, object value ) : bool
enumType Type The enum type.
value object The flags enum value.
Результат bool

ParseFlags() публичный статический Метод

Converts the string representation of one or more member names or values of enumType to its respective value of type enumType.
or is null. is not an enum type /// -or- /// doesn't represent a member name or value of . is outside the range of 's underlying type.
public static ParseFlags ( Type enumType, string value ) : object
enumType Type The enum type.
value string The enum member names or values' string representation.
Результат object

ParseFlags() публичный статический Метод

Converts the string representation of one or more member names or values of enumType to its respective value of type enumType. The parameter ignoreCase specifies if the operation is case-insensitive.
or is null. is not an enum type /// -or- /// doesn't represent a member name or value of . is outside the range of the underlying type of .
public static ParseFlags ( Type enumType, string value, bool ignoreCase ) : object
enumType Type The enum type.
value string The enum member names or values' string representation.
ignoreCase bool Indicates if the operation is case-insensitive.
Результат object

ParseFlags() публичный статический Метод

Converts the string representation of one or more member names or values of enumType delimited with delimiter to its respective value of type enumType. The parameter ignoreCase specifies if the operation is case-insensitive.
or is null. is not an enum type /// -or- /// doesn't represent a member name or value of . is outside the range of the underlying type of .
public static ParseFlags ( Type enumType, string value, bool ignoreCase, string delimiter ) : object
enumType Type The enum type.
value string The enum member names or values' string representation.
ignoreCase bool Indicates if the operation is case-insensitive.
delimiter string The delimiter used to separate individual flags.
Результат object

ParseFlags() публичный статический Метод

Converts the string representation of one or more member names or values of enumType delimited with delimiter to its respective value of type enumType.
or is null. is not an enum type /// -or- /// doesn't represent a member name or value of . is outside the range of 's underlying type.
public static ParseFlags ( Type enumType, string value, string delimiter ) : object
enumType Type The enum type.
value string The enum member names or values' string representation.
delimiter string The delimiter used to separate individual flags.
Результат object

RemoveFlags() публичный статический Метод

Returns value without the flags specified in otherFlags.
, , or is null. is not an enum type /// -or- /// or is of an invalid type.
public static RemoveFlags ( Type enumType, object value, object otherFlags ) : object
enumType Type The enum type.
value object The flags enum value.
otherFlags object The other flags enum value.
Результат object

ToggleFlags() публичный статический Метод

Returns value with all of it's flags toggled. Equivalent to the bitwise "xor" operator with GetAllFlags(Type).
or is null. is not an enum type /// -or- /// is of an invalid type.
public static ToggleFlags ( Type enumType, object value ) : object
enumType Type The enum type.
value object The flags enum value.
Результат object

ToggleFlags() публичный статический Метод

Returns value while toggling the flags that are in otherFlags. Equivalent to the bitwise "xor" operator.
, , or is null. is not an enum type /// -or- /// or is of an invalid type.
public static ToggleFlags ( Type enumType, object value, object otherFlags ) : object
enumType Type The enum type.
value object The flags enum value.
otherFlags object The other flags enum value.
Результат object

TryParseFlags() публичный статический Метод

Tries to convert the string representation of one or more member names or values of enumType to its respective value of type enumType. The parameter ignoreCase specifies whether the operation is case-insensitive. The return value indicates whether the conversion succeeded.
is null. is not an enum type.
public static TryParseFlags ( Type enumType, string value, bool ignoreCase, object &result ) : bool
enumType Type The enum type.
value string The enum member names or values' string representation.
ignoreCase bool Indicates if the operation is case-insensitive.
result object If the conversion succeeds this contains a value of type that is represented by .
Результат bool

TryParseFlags() публичный статический Метод

Tries to convert the string representation of one or more member names or values of enumType delimited with delimiter to its respective value of type enumType. The parameter ignoreCase specifies whether the operation is case-insensitive. The return value indicates whether the conversion succeeded.
is null. is not an enum type.
public static TryParseFlags ( Type enumType, string value, bool ignoreCase, string delimiter, object &result ) : bool
enumType Type The enum type.
value string The enum member names or values' string representation.
ignoreCase bool Indicates if the operation is case-insensitive.
delimiter string The delimiter used to separate individual flags.
result object If the conversion succeeds this contains a value of type that is represented by .
Результат bool

TryParseFlags() публичный статический Метод

Tries to convert the string representation of one or more member names or values of enumType to its respective value of type enumType. The return value indicates whether the conversion succeeded.
is null. is not an enum type.
public static TryParseFlags ( Type enumType, string value, object &result ) : bool
enumType Type The enum type.
value string The enum member names or values' string representation.
result object If the conversion succeeds this contains a value of type that is represented by .
Результат bool

TryParseFlags() публичный статический Метод

Tries to convert the string representation of one or more member names or values of enumType delimited with delimiter to its respective value of type enumType. The return value indicates whether the conversion succeeded.
is null. is not an enum type.
public static TryParseFlags ( Type enumType, string value, string delimiter, object &result ) : bool
enumType Type The enum type.
value string The enum member names or values' string representation.
delimiter string The delimiter used to separate individual flags.
result object If the conversion succeeds this contains a value of type that is represented by .
Результат bool