Click or drag to resize

EnumerationExtensionsWithFlagT Method

Returns the enum value with the specified flag set or cleared, depending on the value argument.

Namespace: Altaxo.Collections
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3448.0 (4.8.3448.0)
Syntax
C#
public static T WithFlag<T>(
	this Enum type,
	T flag,
	bool value
)
where T : struct, new()

Parameters

type  Enum
The enum value to modify.
flag  T
The flag to set or clear.
value  Boolean
If true, the flag is set; if false, the flag is cleared.

Type Parameters

T
The enum type.

Return Value

T
The modified enum value.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Enum. 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