C# Class LuaSharp.Lua

Represents a Lua state.
A Lua state is akin to an AppDomain in .Net.
Inheritance: IDisposable
Afficher le fichier Open project: jsimmons/LuaSharp Class Usage Examples

Méthodes publiques

Méthode Description
CreateTable ( ) : LuaSharp.LuaTable

Creates a new table in the state.

CreateTable ( int initialArrayCapacity, int initialNonArrayCapacity ) : LuaSharp.LuaTable

Creates the table.

Dispose ( ) : void

Releases all resource used by the LuaSharp.Lua object.

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

DoFile ( string filename ) : void

Executes the code contained in a file.

DoString ( string chunk ) : void

Executes a literal chunk of Lua code.

GetValue ( ) : object

Returns the value at the given path.

Lua ( ) : System

Creates a new instance of the Lua class.

SetLibraryPath ( string path ) : void

Sets the path where the Lua state looks for `requires` files.

Paths should be separated by a semicolon, and contain a single question mark `?` where the name of the required library should be substituted.

SetValue ( object o ) : void

Sets the object at path defined by fragments to the object o.

this ( ) : object

Gets or sets the a Lua object with the specified path.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Releases all resource used by the LuaSharp.Lua object.

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

Method Details

CreateTable() public méthode

Creates a new table in the state.
public CreateTable ( ) : LuaSharp.LuaTable
Résultat LuaSharp.LuaTable

CreateTable() public méthode

Creates the table.
/// Is thrown when an argument passed to a method is invalid because it is . ///
public CreateTable ( int initialArrayCapacity, int initialNonArrayCapacity ) : LuaSharp.LuaTable
initialArrayCapacity int /// The initial capacity for array elements. ///
initialNonArrayCapacity int /// THe initial capacity for non-array elements. ///
Résultat LuaSharp.LuaTable

Dispose() public méthode

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

Dispose() protected méthode

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

DoFile() public méthode

Executes the code contained in a file.
public DoFile ( string filename ) : void
filename string /// A containing the path to the file. ///
Résultat void

DoString() public méthode

Executes a literal chunk of Lua code.
public DoString ( string chunk ) : void
chunk string /// A that containes the chunk to execute. ///
Résultat void

GetValue() public méthode

Returns the value at the given path.
public GetValue ( ) : object
Résultat object

Lua() public méthode

Creates a new instance of the Lua class.
public Lua ( ) : System
Résultat System

SetLibraryPath() public méthode

Sets the path where the Lua state looks for `requires` files.
Paths should be separated by a semicolon, and contain a single question mark `?` where the name of the required library should be substituted.
public SetLibraryPath ( string path ) : void
path string /// The library path. ///
Résultat void

SetValue() public méthode

Sets the object at path defined by fragments to the object o.
public SetValue ( object o ) : void
o object /// A the object to set. ///
Résultat void

this() public méthode

Gets or sets the a Lua object with the specified path.
public this ( ) : object
Résultat object