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.

Definition

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

Parameters

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

Type Parameters

TEnum
The type of the enum flags.

Return Value

Boolean
, 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