C# Class Pathoschild.DesignByContract.HasTypeAttribute

Inheritance: System.Attribute, IParameterPrecondition, IReturnValuePrecondition
Afficher le fichier Open project: Pathoschild/DesignByContract

Méthodes publiques

Méthode Description
HasTypeAttribute ( ) : System

Construct a contract precondition that a value must implement an expected type.

OnParameterPrecondition ( ParameterMetadata parameter, object value ) : void

Validate the requirement on a single method parameter or property setter value.

OnReturnValuePrecondition ( ReturnValueMetadata returnValue, object value ) : void

Validate the requirement on a method or property return value.

Méthodes protégées

Méthode Description
GetError ( Type actualType ) : string

Get a contract violation error message.

HasType ( object value, Type types ) : bool

Get whether the value implements an expected type.

Method Details

GetError() protected méthode

Get a contract violation error message.
protected GetError ( Type actualType ) : string
actualType System.Type The type of the value.
Résultat string

HasType() protected méthode

Get whether the value implements an expected type.
protected HasType ( object value, Type types ) : bool
value object The value to check.
types System.Type The expected types that the value must implement.
Résultat bool

HasTypeAttribute() public méthode

Construct a contract precondition that a value must implement an expected type.
public HasTypeAttribute ( ) : System
Résultat System

OnParameterPrecondition() public méthode

Validate the requirement on a single method parameter or property setter value.
The contract requirement was not met.
public OnParameterPrecondition ( ParameterMetadata parameter, object value ) : void
parameter Pathoschild.DesignByContract.Framework.ParameterMetadata The parameter metadata.
value object The parameter value.
Résultat void

OnReturnValuePrecondition() public méthode

Validate the requirement on a method or property return value.
The contract requirement was not met.
public OnReturnValuePrecondition ( ReturnValueMetadata returnValue, object value ) : void
returnValue Pathoschild.DesignByContract.Framework.ReturnValueMetadata The return value metadata.
value object The return value.
Résultat void