Nitro.DynamicMethod< T > Class Template Reference

Detailed Description

Represents a method that can be called at runtime. Essentially acts like a delegate.

Public Member Functions

 DynamicMethod (string name)
 Creates a new dynamic method. More...
 
 DynamicMethod (string name, object onObject)
 Creates a new dynamic method. More...
 
virtual T Run (params object[] arguments)
 Executes this dynamic method with the given arguments. More...
 
Delegate ToDelegate (Type type)
 Converts this Nitro method into a delegate for use with any other kind of event. More...
 

Public Attributes

string Name
 The name of the method being run. More...
 
object Object
 The object it's being run on. More...
 
MethodInfo Method
 MethodInfo the method to run. More...
 

Constructor & Destructor Documentation

Nitro.DynamicMethod< T >.DynamicMethod ( string  name)
inline

Creates a new dynamic method.

Parameters
nameThe name of the method to run.
Nitro.DynamicMethod< T >.DynamicMethod ( string  name,
object  onObject 
)
inline

Creates a new dynamic method.

Parameters
nameThe name of the method to run.
onObjectThe object to run this method on.

Member Function Documentation

virtual T Nitro.DynamicMethod< T >.Run ( params object[]  arguments)
inlinevirtual

Executes this dynamic method with the given arguments.

Parameters
argumentsThe arguments to pass to the method
Returns
The return value of the method, if any.
Delegate Nitro.DynamicMethod< T >.ToDelegate ( Type  type)
inline

Converts this Nitro method into a delegate for use with any other kind of event.

Parameters
typeThe type of the target event.

Member Data Documentation

MethodInfo Nitro.DynamicMethod< T >.Method

MethodInfo the method to run.

string Nitro.DynamicMethod< T >.Name

The name of the method being run.

object Nitro.DynamicMethod< T >.Object

The object it's being run on.