EnumTEnumGetDefinedOrDefault(TEnum, TEnum) Method
Returns value if it is defined in TEnum;
otherwise, returns defaultValue, even if it is undefined.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0-preview.1
public static TEnum GetDefinedOrDefault(
TEnum value,
TEnum defaultValue = null
)
Public Shared Function GetDefinedOrDefault (
value As TEnum,
Optional defaultValue As TEnum = Nothing
) As TEnum
public:
static TEnum GetDefinedOrDefault(
TEnum value,
TEnum defaultValue = nullptr
)
static member GetDefinedOrDefault :
value : 'TEnum *
?defaultValue : 'TEnum
(* Defaults:
let _defaultValue = defaultArg defaultValue null
*)
-> 'TEnum
- value TEnum
- A TEnum value.
- defaultValue TEnum (Optional)
- A TEnum value to return if value
is not defined in TEnum. It does not needed to be a defined value. This parameter is optional.
Default value: The bitwise zero value of TEnum.
TEnumvalue if it is defined in
TEnum;
otherwise,
defaultValue, even if it is undefined.