![]() |
Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
|
Collection of variables. More...
Public Member Functions | |
| Variables (params Variable[] Variables) | |
| Collection of variables. More... | |
| virtual bool | TryGetVariable (string Name, out Variable Variable) |
| Tries to get a variable object, given its name. More... | |
| virtual bool | ContainsVariable (string Name) |
| If the collection contains a variable with a given name. More... | |
| virtual Variable | Add (string Name, object Value) |
| Adds a variable to the collection. More... | |
| virtual bool | Remove (string VariableName) |
| Removes a varaiable from the collection. More... | |
| virtual void | Clear () |
| Removes all variables from the collection. More... | |
| virtual void | Push () |
| Pushes the current set of variables to the stack. This state is restored by calling Pop. Each call to this method must be followed by exactly one call to Pop. More... | |
| virtual void | Pop () |
| Pops a previously stored set of variables from the stack. Variables are stored on the stack by calling Push. More... | |
| IEnumerator< Variable > | GetEnumerator () |
| Returns an enumerator that iterates through a collection. More... | |
| void | CopyTo (Variables Variables) |
| Copies available variables to another variable collection. More... | |
| void | Abort () |
| Aborts the execution of script using this collection of variables. More... | |
| void | CancelAbort () |
| Allows new script to be evaluated using this collection of variables. More... | |
| async Task | Preview (Expression Expression, IElement Result) |
| Reports a preview of the final result. More... | |
| async Task | Status (Expression Expression, string Result) |
| Reports current status of execution. More... | |
Protected Attributes | |
| Dictionary< string, Variable > | variables = new Dictionary<string, Variable>() |
| Internal set of variables. More... | |
Properties | |
| object | this[string Name] [get, set] |
| Access to variable values through the use of their names. More... | |
| TextWriter | ConsoleOut [get, set] |
| Console out interface. Can be used by functions and script to output data to the console. More... | |
| IContextVariables | ContextVariables [get, set] |
| Variables available during the current context. More... | |
| ValuePrinter | Printer [get, set] |
| Delegate that converts values to strings for (implicit) printing. Default is null, which will call the Object.ToString() method to convert the value to a string. More... | |
| Variable[] | AvailableVariables [get] |
| Returns an array of available variables. More... | |
| bool | Aborted [get] |
| If the script has been aborted. More... | |
| bool | Active [get] |
| If script is still active (i.e. has not been aborted). More... | |
| bool | HandlesPreview [get] |
| If previews are desired. More... | |
| bool | HandlesStatus [get] |
| If status messages are desired. More... | |
| CancellationToken | CancellationToken [get] |
| Cancellation token, that can be used to monitor for script abortion. More... | |
Events | |
| EventHandlerAsync< PreviewEventArgs > | OnPreview |
| Event raised when there is a new value to preview. More... | |
| EventHandlerAsync< StatusEventArgs > | OnStatus = null |
| Event raised when a status message has been reported. More... | |
Collection of variables.
Definition at line 24 of file Variables.cs.
| Waher.Script.Variables.Variables | ( | params Variable[] | Variables | ) |
Collection of variables.
Definition at line 41 of file Variables.cs.
| void Waher.Script.Variables.Abort | ( | ) |
Aborts the execution of script using this collection of variables.
Definition at line 349 of file Variables.cs.
|
virtual |
Adds a variable to the collection.
| Name | Variable name. |
| Value | Associated variable object value. |
Implements Waher.Script.IContextVariables.
Reimplemented in Waher.Script.Persistence.SQL.ObjectProperties.
Definition at line 126 of file Variables.cs.
| void Waher.Script.Variables.CancelAbort | ( | ) |
Allows new script to be evaluated using this collection of variables.
Definition at line 361 of file Variables.cs.
|
virtual |
Removes all variables from the collection.
Definition at line 167 of file Variables.cs.
|
virtual |
If the collection contains a variable with a given name.
| Name | Variable name. |
Implements Waher.Script.IContextVariables.
Reimplemented in TAG.Simulator.ObjectModel.Events.EventVariables, Waher.Networking.HTTP.SessionVariables, Waher.Networking.HTTP.SessionVariables, Waher.Script.Persistence.SQL.ObjectProperties, and Waher.Security.WAF.Model.RequestVariables.
Definition at line 80 of file Variables.cs.
| void Waher.Script.Variables.CopyTo | ( | Variables | Variables | ) |
Copies available variables to another variable collection.
Definition at line 334 of file Variables.cs.
| IEnumerator< Variable > Waher.Script.Variables.GetEnumerator | ( | ) |
Returns an enumerator that iterates through a collection.
Definition at line 275 of file Variables.cs.
|
virtual |
Pops a previously stored set of variables from the stack. Variables are stored on the stack by calling Push.
Definition at line 206 of file Variables.cs.
| async Task Waher.Script.Variables.Preview | ( | Expression | Expression, |
| IElement | Result | ||
| ) |
Reports a preview of the final result.
| Expression | Expression being executed. |
| Result | Preview |
Definition at line 407 of file Variables.cs.
|
virtual |
Pushes the current set of variables to the stack. This state is restored by calling Pop. Each call to this method must be followed by exactly one call to Pop.
Definition at line 184 of file Variables.cs.
|
virtual |
Removes a varaiable from the collection.
| VariableName | Name of variable. |
Reimplemented in TAG.Simulator.ObjectModel.Events.EventVariables.
Definition at line 151 of file Variables.cs.
| async Task Waher.Script.Variables.Status | ( | Expression | Expression, |
| string | Result | ||
| ) |
Reports current status of execution.
| Expression | Expression. |
| Result | Status Message |
Definition at line 424 of file Variables.cs.
Tries to get a variable object, given its name.
Implements Waher.Script.IContextVariables.
Reimplemented in Waher.Networking.HTTP.SessionVariables, Waher.Networking.HTTP.SessionVariables, Waher.Script.Persistence.SQL.ObjectProperties, and Waher.Security.WAF.Model.RequestVariables.
Definition at line 56 of file Variables.cs.
|
protected |
Internal set of variables.
Definition at line 29 of file Variables.cs.
|
get |
If the script has been aborted.
Definition at line 373 of file Variables.cs.
|
get |
If script is still active (i.e. has not been aborted).
Definition at line 378 of file Variables.cs.
|
get |
Returns an array of available variables.
Definition at line 250 of file Variables.cs.
|
get |
Cancellation token, that can be used to monitor for script abortion.
Definition at line 444 of file Variables.cs.
|
getset |
Console out interface. Can be used by functions and script to output data to the console.
Definition at line 222 of file Variables.cs.
|
getset |
Variables available during the current context.
Definition at line 231 of file Variables.cs.
|
get |
If previews are desired.
Definition at line 388 of file Variables.cs.
|
get |
If status messages are desired.
Definition at line 434 of file Variables.cs.
|
getset |
Delegate that converts values to strings for (implicit) printing. Default is null, which will call the Object.ToString() method to convert the value to a string.
Definition at line 241 of file Variables.cs.
|
getset |
Access to variable values through the use of their names.
| Name | Variable name. |
Definition at line 104 of file Variables.cs.
| EventHandlerAsync<PreviewEventArgs> Waher.Script.Variables.OnPreview |
Event raised when there is a new value to preview.
Definition at line 383 of file Variables.cs.
| EventHandlerAsync<StatusEventArgs> Waher.Script.Variables.OnStatus = null |
Event raised when a status message has been reported.
Definition at line 439 of file Variables.cs.