EnumExtensionsGetDefinedOrNullTEnum Method
Returns value if it is defined in TEnum; otherwise, returns .
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
public static TEnum? GetDefinedOrNull<TEnum>(
this TEnum value
)
where TEnum : struct, new()
<ExtensionAttribute>
Public Shared Function GetDefinedOrNull(Of TEnum As {Structure, New}) (
value As TEnum
) As TEnum?
public:
[ExtensionAttribute]
generic<typename TEnum>
where TEnum : value class, gcnew()
static Nullable<TEnum> GetDefinedOrNull(
TEnum value
)
[<ExtensionAttribute>]
static member GetDefinedOrNull :
value : 'TEnum -> Nullable<'TEnum> when 'TEnum : struct, new()
- value TEnum
- A TEnum value.
- TEnum
- The type of the enum value.
NullableTEnumvalue if it is defined in
TEnum; otherwise,
.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).