EnumTEnumGetFlags(TEnum, Boolean) Method

Gets an IEnumerableT enumeration of flags, 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(
	TEnum flags,
	bool onlyDefinedValues = false
)

Parameters

flags  TEnum
A flags enum value, whose flags should be returned. It is not checked whether TEnum is really marked by FlagsAttribute.
onlyDefinedValues  Boolean  (Optional)
to return only flags that are defined in TEnum; to return also undefined flags. This parameter is optional.
Default value: .

Return Value

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

Remarks

  Note

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

See Also