C# Класс Microsoft.WindowsPhone.Samples.Notifications.Guard

A static helper class that includes various parameter checking routines.
Показать файл Открыть проект

Открытые методы

Метод Описание
ArgumentNotNull ( object argumentValue, string argumentName ) : void

Throws ArgumentNullException if the given argument is null.

ArgumentNotNullOrEmpty ( string argumentValue, string argumentName ) : void

Throws an exception if the tested string argument is null or the empty string.

TypeIsAssignable ( Type assignmentTargetType, Type assignmentValueType, string argumentName ) : void

Verifies that an argument type is assignable from the provided type (meaning interfaces are implemented, or classes exist in the base class hierarchy).

Приватные методы

Метод Описание
GetTypeName ( object assignmentInstance ) : string
InstanceIsAssignable ( Type assignmentTargetType, object assignmentInstance, string argumentName ) : void

Описание методов

ArgumentNotNull() публичный статический Метод

Throws ArgumentNullException if the given argument is null.
if tested value if null.
public static ArgumentNotNull ( object argumentValue, string argumentName ) : void
argumentValue object Argument value to test.
argumentName string Name of the argument being tested.
Результат void

ArgumentNotNullOrEmpty() публичный статический Метод

Throws an exception if the tested string argument is null or the empty string.
Thrown if string value is null. Thrown if the string is empty
public static ArgumentNotNullOrEmpty ( string argumentValue, string argumentName ) : void
argumentValue string Argument value to check.
argumentName string Name of argument being checked.
Результат void

TypeIsAssignable() публичный статический Метод

Verifies that an argument type is assignable from the provided type (meaning interfaces are implemented, or classes exist in the base class hierarchy).
public static TypeIsAssignable ( Type assignmentTargetType, Type assignmentValueType, string argumentName ) : void
assignmentTargetType System.Type The argument type that will be assigned to.
assignmentValueType System.Type The type of the value being assigned.
argumentName string Argument name.
Результат void