C# Класс Pathoschild.DesignByContract.Framework.Constraints.RequiresTypeAttribute

Наследование: System.Attribute, IValidateContractUsageAttribute
Показать файл Открыть проект

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

Метод Описание
GetError ( ParameterMetadata parameter ) : string

Get an error message indicating why the usage is invalid (or null if usage is valid).

GetError ( ReturnValueMetadata returnValue ) : string

Get an error message indicating why the usage is invalid (or null if usage is valid).

RequiresTypeAttribute ( ) : System

Construct an instance.

The valid types the contract can annotate.

Защищенные методы

Метод Описание
IsAllowedType ( Type type ) : bool

Get whether a type is compatible with the AllowedTypes.

IsAllowedType ( string typeName, bool typeIsUnknown ) : bool

Get whether a type is compatible with the AllowedTypes.

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

GetError() публичный Метод

Get an error message indicating why the usage is invalid (or null if usage is valid).
public GetError ( ParameterMetadata parameter ) : string
parameter ParameterMetadata Represents a parameter annotated by a single contract annotation.
Результат string

GetError() публичный Метод

Get an error message indicating why the usage is invalid (or null if usage is valid).
public GetError ( ReturnValueMetadata returnValue ) : string
returnValue ReturnValueMetadata Represents a return value annotated by a single contract annotation.
Результат string

IsAllowedType() защищенный Метод

Get whether a type is compatible with the AllowedTypes.
protected IsAllowedType ( Type type ) : bool
type System.Type The actual value type.
Результат bool

IsAllowedType() защищенный Метод

Get whether a type is compatible with the AllowedTypes.
protected IsAllowedType ( string typeName, bool typeIsUnknown ) : bool
typeName string The full name of the actual value type.
typeIsUnknown bool Whether the type is not known at compile-time. This occurs when the type is generic and the type isn't specified in code.
Результат bool

RequiresTypeAttribute() публичный Метод

Construct an instance. The valid types the contract can annotate.
public RequiresTypeAttribute ( ) : System
Результат System