Click or drag to resize

GuardArgumentIsNotOfTypeT Method (Boolean, Object, String, String)

Throws an exception if argumentValue is of type T or a subtype of T.

Namespace:  Enkoni.Framework
Assembly:  Enkoni.Framework (in Enkoni.Framework.dll) Version: 1.3.0.1
Syntax
public static void ArgumentIsNotOfType<T>(
	bool disallowDerivedTypes,
	Object argumentValue,
	string argumentName,
	string message
)

Parameters

disallowDerivedTypes
Type: SystemBoolean
Indicates if derived types are also not allowed.
argumentValue
Type: SystemObject
The argument value to test.
argumentName
Type: SystemString
Name of the argument.
message
Type: SystemString
The message that will be passed to the exception.

Type Parameters

T
The type that is not expected.
Exceptions
ExceptionCondition
ArgumentExceptionValidation error.
Remarks
This method will not test for values. When argumentValue equals , this method will break. To test for values, use the ArgumentIsNotNull(Object, String) method.
See Also