Table of Contents

ThrowIfNotEnum Method

Definition

Namespace
Cuemon
Assemblies
Cuemon.Kernel.dll
Source
src/Cuemon.Kernel/Validator.cs

ThrowIfNotEnum<TEnum>(string, bool, string, string)

Validates and throws an ArgumentException if the specified argument does not represents an enumeration.

public static void ThrowIfNotEnum<TEnum>(string argument, bool ignoreCase = true, string message = "Value does not represents an enumeration.", string paramName = null) where TEnum : struct, IConvertible

Parameters

argument string

The value to be evaluated.

ignoreCase bool

true to ignore case; false to regard case.

message string

A message that describes the error.

paramName string

The name of the parameter that caused the exception.

Type Parameters

TEnum

The type of the enumeration.

Exceptions

ArgumentException

argument does not represents an enumeration.