C# Class LuaSharp.ClrFunction

Represents a CLR function.
It is safe to share functions across Lua states.
Inheritance: IDisposable
Mostra file Open project: jsimmons/LuaSharp Class Usage Examples

Public Methods

Method Description
ClrFunction ( ) : System

Initializes a new instance of the LuaSharp.ClrFunction class.

Dispose ( ) : void

Releases all resource used by the LuaSharp.ClrFunction object.

Call Dispose when you are finished using the LuaSharp.ClrFunction. The Dispose method leaves the LuaSharp.ClrFunction in an unusable state. After calling Dispose, you must release all references to the LuaSharp.ClrFunction so the garbage collector can reclaim the memory that the LuaSharp.ClrFunction was occupying.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases all resource used by the LuaSharp.ClrFunction object.

Call Dispose when you are finished using the LuaSharp.ClrFunction. The Dispose method leaves the LuaSharp.ClrFunction in an unusable state. After calling Dispose, you must release all references to the LuaSharp.ClrFunction so the garbage collector can reclaim the memory that the LuaSharp.ClrFunction was occupying.

InvokeDispose ( ) : void

Invokes the Dispose(bool) method, guarding against repeated disposes.

This can be used to call Dispose(bool) from a finalizer if one is added to a class that inherits from this one.

OnInvoke ( Lua state, object args ) : object[]

Called when the function should be invoked.

Private Methods

Method Description
Invoke ( IntPtr s ) : int

Called when lua requests that the function is invoked.

Method Details

ClrFunction() public method

Initializes a new instance of the LuaSharp.ClrFunction class.
public ClrFunction ( ) : System
return System

Dispose() public method

Releases all resource used by the LuaSharp.ClrFunction object.
Call Dispose when you are finished using the LuaSharp.ClrFunction. The Dispose method leaves the LuaSharp.ClrFunction in an unusable state. After calling Dispose, you must release all references to the LuaSharp.ClrFunction so the garbage collector can reclaim the memory that the LuaSharp.ClrFunction was occupying.
public Dispose ( ) : void
return void

Dispose() protected method

Releases all resource used by the LuaSharp.ClrFunction object.
Call Dispose when you are finished using the LuaSharp.ClrFunction. The Dispose method leaves the LuaSharp.ClrFunction in an unusable state. After calling Dispose, you must release all references to the LuaSharp.ClrFunction so the garbage collector can reclaim the memory that the LuaSharp.ClrFunction was occupying.
protected Dispose ( bool disposing ) : void
disposing bool
return void

InvokeDispose() protected method

Invokes the Dispose(bool) method, guarding against repeated disposes.
This can be used to call Dispose(bool) from a finalizer if one is added to a class that inherits from this one.
protected InvokeDispose ( ) : void
return void

OnInvoke() protected abstract method

Called when the function should be invoked.
protected abstract OnInvoke ( Lua state, object args ) : object[]
state Lua /// The Lua state that is calling the function. ///
args object /// The arguments that were passed to the function. ///
return object[]