Click or drag to resize

enumEnumFlagsT Method

Generates all the enum members of a particular enum, filtering in only ones detected as distinct flags.

Namespace:  WhetStone.Looping
Assembly:  WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntax
C#
public static IEnumerable<T> EnumFlags<T>()
where T : struct, new(), IConvertible

Type Parameters

T
The enum type.

Return Value

Type: IEnumerableT
All the enum members detected as flag members.
Remarks

Uses reflection to generate types.

Detecting Flags is tricky, will only return members that are bitwise distinct from all of the previous ones. This means that the elements generated are dependent on the order they are generated.

Examples
[Flags] enum Enum1 {a=1,b=2,c=3 };
@enum.EnumFlags<Enum1>();// a,b
See Also