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.
파일 보기 프로젝트 열기: TylerBrinkley/Enums.NET

공개 메소드들

메소드 설명
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