EnumTEnumGetFlags Method

Gets the defined flags in TEnum, where each flags are returned as distinct values.

Definition

Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0-preview.1
C#
public static IEnumerable<TEnum> GetFlags()

Return Value

IEnumerableTEnum
A lazy-enumerated IEnumerableT instance containing each flags of TEnum as distinct values.

Remarks

Flag values are the ones whose binary representation contains only a single bit.

It is not checked whether TEnum is really marked by FlagsAttribute.

Flags with the same values but different names are returned only once.

  Note

The enumerator of the returned collection does not support the IEnumerator.Reset method.

See Also