C# Class ImageTools.Helpers.Guard

A static class with a lot of helper methods, which guards a method agains invalid parameters.
Show file Open project: prepare/HTML-Renderer

Public Methods

Method Description
NotNull ( object target, string parameterName ) : void

Verifies, that the method parameter with specified object value and message is not null and throws an exception if the object is null.

NotNullOrEmpty ( string target, string parameterName ) : void

Verifies, that the string method parameter with specified object value and message is not null, not empty and does not contain only blanls and throws an exception if the object is null.

Method Details

NotNull() public static method

Verifies, that the method parameter with specified object value and message is not null and throws an exception if the object is null.
is /// null (Nothing in Visual Basic).
public static NotNull ( object target, string parameterName ) : void
target object The target object, which cannot be null.
parameterName string Name of the parameter.
return void

NotNullOrEmpty() public static method

Verifies, that the string method parameter with specified object value and message is not null, not empty and does not contain only blanls and throws an exception if the object is null.
is /// null (Nothing in Visual Basic). is /// empty or contains only blanks.
public static NotNullOrEmpty ( string target, string parameterName ) : void
target string The target string, which should be checked against being null or empty.
parameterName string Name of the parameter.
return void