C# Class Jurassic.Compiler.ClrBinder

Binds to a method group using pretty standard .NET rules. The main difference from the JSBinder is that the number of arguments must be correct. Additionally, it is possible to bind to overloaded methods with the same number of arguments.
Inheritance: MethodBinder
Afficher le fichier Open project: paulbartrum/jurassic Class Usage Examples

Méthodes publiques

Méthode Description
ClrBinder ( IEnumerable targetMethods ) : System

Creates a new ClrBinder instance.

ClrBinder ( IEnumerable targetMethods ) : System

Creates a new ClrBinder instance.

ClrBinder ( MethodBase targetMethod ) : System

Creates a new ClrBinder instance.

Méthodes protégées

Méthode Description
GenerateStub ( ILGenerator generator, int argumentCount ) : void

Generates a method that does type conversion and calls the bound method.

Private Methods

Méthode Description
EmitConversionToObject ( ILGenerator generator, Type fromType ) : void

Pops the value on the stack, converts it to an object, then pushes the result onto the stack.

EmitConversionToType ( ILGenerator generator, Type toType, bool convertToAddress ) : void

Pops the value on the stack, converts it from an object to the given type, then pushes the result onto the stack.

Method Details

ClrBinder() public méthode

Creates a new ClrBinder instance.
public ClrBinder ( IEnumerable targetMethods ) : System
targetMethods IEnumerable An enumerable list of methods to bind to.
Résultat System

ClrBinder() public méthode

Creates a new ClrBinder instance.
public ClrBinder ( IEnumerable targetMethods ) : System
targetMethods IEnumerable An enumerable list of methods to bind to.
Résultat System

ClrBinder() public méthode

Creates a new ClrBinder instance.
public ClrBinder ( MethodBase targetMethod ) : System
targetMethod System.Reflection.MethodBase A method to bind to.
Résultat System

GenerateStub() protected méthode

Generates a method that does type conversion and calls the bound method.
protected GenerateStub ( ILGenerator generator, int argumentCount ) : void
generator ILGenerator The ILGenerator used to output the body of the method.
argumentCount int The number of arguments that will be passed to the delegate.
Résultat void