EnumExtensionsAllFlagsDefinedTEnum(TEnum) Method

Gets whether every single bit value in flags are defined in the TEnum type, or, when flags is zero, it is checked whether zero is defined in TEnum.


Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
public static bool AllFlagsDefined<TEnum>(
	this TEnum flags
where TEnum : struct, new()


flags  TEnum
A flags enum value, whose flags should be checked. It is not checked whether TEnum is really marked by FlagsAttribute.

Type Parameters

The type of the enum flags.

Return Value

, if flags is a zero value and zero is defined, or if flags is nonzero and its every bit has a defined name.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type TEnum. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also