Class Table
A class representing a Lua table.
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public class Table : RefIdObject, IScriptPrivateResource
Constructors
Table(Script)
Initializes a new instance of the Table class.
Declaration
public Table(Script owner)
Parameters
Script
owner
The owner script. |
Table(Script, DynValue[])
Initializes a new instance of the Table class.
Declaration
public Table(Script owner, params DynValue[] arrayValues)
Parameters
Script
owner
The owner. |
DynValue[]
arrayValues
The values for the "array-like" part of the table. |
Properties
Item[Object]
Gets or sets the System.Object with the specified key(s). This will marshall CLR and MoonSharp objects in the best possible way.
Declaration
public object this[object key] { get; set; }
Parameters
System.Object
key
The key. |
Property Value
System.Object
The System.Object. |
Item[Object[]]
Gets or sets the System.Object with the specified key(s). This will marshall CLR and MoonSharp objects in the best possible way. Multiple keys can be used to access subtables.
Declaration
public object this[params object[] keys] { get; set; }
Parameters
System.Object[]
keys
The keys to access the table and subtables |
Property Value
System.Object
The System.Object. |
Keys
Enumerates the keys.
Declaration
public IEnumerable<DynValue> Keys { get; }
Property Value
IEnumerable<DynValue>
|
Length
Gets the length of the "array part".
Declaration
public int Length { get; }
Property Value
System.Int32
|
MetaTable
Gets the meta-table associated with this instance.
Declaration
public Table MetaTable { get; set; }
Property Value
Table
|
OwnerScript
Gets the script owning this resource.
Declaration
public Script OwnerScript { get; }
Property Value
Script
|
Implements
Pairs
Enumerates the key/value pairs.
Declaration
public IEnumerable<TablePair> Pairs { get; }
Property Value
IEnumerable<TablePair>
|
Values
Enumerates the values
Declaration
public IEnumerable<DynValue> Values { get; }
Property Value
IEnumerable<DynValue>
|
Methods
Append(DynValue)
Append the value to the table using the next available integer index.
Declaration
public void Append(DynValue value)
Parameters
DynValue
value
The value. |
Clear()
Removes all items from the Table.
Declaration
public void Clear()
CollectDeadKeys()
Collects the dead keys. This frees up memory but invalidates pending iterators. It's called automatically internally when the semantics of Lua tables allow, but can be forced externally if it's known that no iterators are pending.
Declaration
public void CollectDeadKeys()
Get(DynValue)
Gets the value associated with the specified key.
Declaration
public DynValue Get(DynValue key)
Parameters
DynValue
key
The key. |
Returns
DynValue
|
Get(Int32)
Gets the value associated with the specified key.
Declaration
public DynValue Get(int key)
Parameters
System.Int32
key
The key. |
Returns
DynValue
|
Get(Object)
Gets the value associated with the specified key. (expressed as a System.Object).
Declaration
public DynValue Get(object key)
Parameters
System.Object
key
The key. |
Returns
DynValue
|
Get(Object[])
Gets the value associated with the specified keys (expressed as an array of System.Object). This will marshall CLR and MoonSharp objects in the best possible way. Multiple keys can be used to access subtables.
Declaration
public DynValue Get(params object[] keys)
Parameters
System.Object[]
keys
The keys to access the table and subtables |
Returns
DynValue
|
Get(String)
Gets the value associated with the specified key.
Declaration
public DynValue Get(string key)
Parameters
System.String
key
The key. |
Returns
DynValue
|
NextKey(DynValue)
Returns the next pair from a value
Declaration
public TablePair? NextKey(DynValue v)
Parameters
DynValue
v
|
Returns
System.Nullable<TablePair>
|
RawGet(DynValue)
Gets the value associated with the specified key, without bringing to Nil the non-existant values.
Declaration
public DynValue RawGet(DynValue key)
Parameters
DynValue
key
The key. |
Returns
DynValue
|
RawGet(Int32)
Gets the value associated with the specified key, without bringing to Nil the non-existant values.
Declaration
public DynValue RawGet(int key)
Parameters
System.Int32
key
The key. |
Returns
DynValue
|
RawGet(Object)
Gets the value associated with the specified key, without bringing to Nil the non-existant values.
Declaration
public DynValue RawGet(object key)
Parameters
System.Object
key
The key. |
Returns
DynValue
|
RawGet(Object[])
Gets the value associated with the specified keys (expressed as an array of System.Object). This will marshall CLR and MoonSharp objects in the best possible way. Multiple keys can be used to access subtables.
Declaration
public DynValue RawGet(params object[] keys)
Parameters
System.Object[]
keys
The keys to access the table and subtables |
Returns
DynValue
|
RawGet(String)
Gets the value associated with the specified key, without bringing to Nil the non-existant values.
Declaration
public DynValue RawGet(string key)
Parameters
System.String
key
The key. |
Returns
DynValue
|
Remove(DynValue)
Remove the value associated with the specified key from the table.
Declaration
public bool Remove(DynValue key)
Parameters
DynValue
key
The key. |
Returns
System.Boolean
|
Remove(Int32)
Remove the value associated with the specified key from the table.
Declaration
public bool Remove(int key)
Parameters
System.Int32
key
The key. |
Returns
System.Boolean
|
Remove(Object)
Remove the value associated with the specified key from the table.
Declaration
public bool Remove(object key)
Parameters
System.Object
key
The key. |
Returns
System.Boolean
|
Remove(Object[])
Remove the value associated with the specified keys from the table. Multiple keys can be used to access subtables.
Declaration
public bool Remove(params object[] keys)
Parameters
System.Object[]
keys
|
Returns
System.Boolean
|
Remove(String)
Remove the value associated with the specified key from the table.
Declaration
public bool Remove(string key)
Parameters
System.String
key
The key. |
Returns
System.Boolean
|
Set(DynValue, DynValue)
Sets the value associated to the specified key.
Declaration
public void Set(DynValue key, DynValue value)
Parameters
DynValue
key
The key. |
DynValue
value
The value. |
Set(Int32, DynValue)
Sets the value associated to the specified key.
Declaration
public void Set(int key, DynValue value)
Parameters
System.Int32
key
The key. |
DynValue
value
The value. |
Set(Object, DynValue)
Sets the value associated with the specified key.
Declaration
public void Set(object key, DynValue value)
Parameters
System.Object
key
The key. |
DynValue
value
The value. |
Set(Object[], DynValue)
Sets the value associated with the specified keys. Multiple keys can be used to access subtables.
Declaration
public void Set(object[] keys, DynValue value)
Parameters
System.Object[]
keys
|
DynValue
value
The value. |
Set(String, DynValue)
Sets the value associated to the specified key.
Declaration
public void Set(string key, DynValue value)
Parameters
System.String
key
The key. |
DynValue
value
The value. |