Table of Contents

ThrowIfEnum Method

Definition

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

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

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

public static void ThrowIfEnum<TEnum>(string argument, bool ignoreCase = true, string message = "Value 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 represents an enumeration.