Table of Contents

Class Table

Namespace
Luny
/
Assembly
Luny.dll

Dictionary-based variable storage.

public sealed class Table : ITable, IEnumerable<KeyValuePair<String, Variable>>, IEnumerable
Expand Details ...
Inheritance
Object
Table
Implements

Constructors

Table()

public Table()

Properties

Count

Gets the number of variables.

public Int32 Count { get; }

Property Value

Int32

this[String]

Gets or sets a variable by name.

public Variable this[String key] { get; set; }

Parameters

Type Name Description
String
key

Property Value

Variable

Methods

DefineConstant(String, Variable)

Defines a constant variable that cannot be modified after creation.

public Table.VarHandle DefineConstant(String key, Variable variable)

Parameters

Type Name Description
String
key

The constant name.

Variable
variable

The constant value.

Returns

Table.VarHandle

The handle to the constant.

DefineVariable(String, Variable)

Defines a variable with initial value.

public Table.VarHandle DefineVariable(String key, Variable variable)

Parameters

Type Name Description
String
key
Variable
variable

Returns

Table.VarHandle

Exceptions

InvalidOperationException

GetEnumerator()

public IEnumerator<KeyValuePair<String, Variable>> GetEnumerator()

Returns

IEnumerator<KeyValuePair<String, Variable>>

GetHandle(String)

Gets a handle to a variable.

public Table.VarHandle GetHandle(String key)

Parameters

Type Name Description
String
key

Returns

Table.VarHandle

GetHandle<T>(String)

Gets or creates a typed handle to a variable.

public Table.VarHandle<T> GetHandle<T>(String key)

Parameters

Type Name Description
String
key

Returns

Table.VarHandle<T>

Type Parameters

T

Get<T>(String)

Gets a variable with type casting.

public T Get<T>(String key)

Parameters

Type Name Description
String
key

Returns

T

Type Parameters

T

Has(String)

Checks if a variable exists.

public Boolean Has(String key)

Parameters

Type Name Description
String
key

Returns

Boolean

Remove(String)

Removes a variable.

public Boolean Remove(String key)

Parameters

Type Name Description
String
key

Returns

Boolean

RemoveAll()

Removes all variables.

public void RemoveAll()

ResetValue(String)

Resets a variable's value to default.

public void ResetValue(String key)

Parameters

Type Name Description
String
key

ResetValues()

Resets values of all variables to their default value.

public void ResetValues()

ToString()

[ExcludeFromCodeCoverage]
public override String ToString()

Returns

String

Events

OnVariableChanged

Fired when a variable is changed.

public event EventHandler<VariableChangedArgs> OnVariableChanged

Event Type

EventHandler<VariableChangedArgs>