共用方式為


Throw Class

Definition

Defines utility methods for validating arguments.

public static class Throw
type Throw = class
Public Class Throw
Inheritance
Throw

Methods

IfArgument(Boolean, String, String)

Throws ArgumentException with the given parameter name and optional message if the given Boolean value is true.

IfArgumentNull<T>(T, String, String)

Throws ArgumentNullException with the given parameter name and optional message if the given reference is null.

IfArgumentNullOrEmpty(String, String, String)

Throws ArgumentNullException or ArgumentException with the given parameter name and optional message if the given string is null or empty, respectively.

IfArgumentOutOfRange(Boolean, String, String)

Throws ArgumentOutOfRangeException with the given parameter name and optional message if the given Boolean value is true.

IfNullOrEmptySearchServiceName(String)

Throws ArgumentNullException or ArgumentException with a pre-determined message if the given search service name is null or empty, respectively.

Applies to