A particular script engine. Derive from this if you wish to create your own.
Public Member Functions | |
void | AddCode (string code) |
Adds the given nitro code to the document. Used by script tags. Note that this will not work at runtime if the code if this document has already been compiled. More... | |
void | AddCode (string code, int index) |
Adds the given Nitro code to the engine. Used by script tags. Note that this will not work at runtime if the code if this document has already been compiled. More... | |
int | GetCodeIndex () |
Gets a new code index in the CodeBuffer array. More... | |
virtual string[] | GetTypes () |
The meta types that your engine will handle. E.g. "text/javascript". More... | |
virtual ScriptEngine | Instance (Document document) |
When a type of script is encountered on the document, this is called to instance a script engine. You can share a single global instance if you wish by returning this. Return null if the engine can't be used by the given document. More... | |
virtual object | RunLiteral (string name, object context, object[] args, bool optional) |
Runs a nitro function by name with a set of arguments only if the method exists. More... | |
object | Run (string name, params object[] args) |
Runs a nitro function by name with optional arguments. More... | |
object | RunLiteral (string name, object[] args) |
Runs a nitro function by name with a set of arguments. More... | |
object | RunLiteral (string name, object context, object[] args) |
Runs a nitro function by name with a set of arguments. More... | |
object | RunLiteral (string name, object[] args, bool optional) |
Runs a nitro function by name with a set of arguments only if the method exists. More... | |
object | RunOptionally (string name, object context, params object[] args) |
Runs a nitro function by name with a set of arguments only if the method exists. More... | |
object | RunOptionally (string name, params object[] args) |
Runs a nitro function by name with a set of arguments only if the method exists. More... | |
bool | TryCompile () |
Attempts to compile the code. It's only successful if there are no nulls in the code buffer. More... | |
Public Attributes | |
string[] | CodeBuffer |
All code in script tags is buffered and compiled in one go. This is the buffer. More... | |
Document | Document |
The document this engine is for (if any). More... | |
Protected Member Functions | |
virtual void | Compile (string code) |
Loads the given textual code for the given document. PowerUI ensures order for you including when scripts are downloaded from the internet. More... | |
Properties | |
HtmlDocument | htmlDocument [get] |
The HTML document this engine is for (if any). More... | |
object | GlobalScope [get] |
The global scripting scope. More... | |
bool | AotDocument [get] |
virtual object | this[string global] [get, set] |
Gets or sets script variable values. More... | |
|
inline |
Adds the given nitro code to the document. Used by script tags. Note that this will not work at runtime if the code if this document has already been compiled.
code | The nitro code to add to the document. |
|
inline |
Adds the given Nitro code to the engine. Used by script tags. Note that this will not work at runtime if the code if this document has already been compiled.
code | The nitro code to add to the document. |
index | The index in the code buffer to add the code into. |
|
inlineprotectedvirtual |
Loads the given textual code for the given document. PowerUI ensures order for you including when scripts are downloaded from the internet.
Reimplemented in PowerUI.NitroScriptEngine.
|
inline |
Gets a new code index in the CodeBuffer array.
|
inlinevirtual |
The meta types that your engine will handle. E.g. "text/javascript".
Reimplemented in PowerUI.NitroScriptEngine.
|
inlinevirtual |
When a type of script is encountered on the document, this is called to instance a script engine. You can share a single global instance if you wish by returning this. Return null if the engine can't be used by the given document.
Reimplemented in PowerUI.NitroScriptEngine.
|
inline |
Runs a nitro function by name with optional arguments.
name | The name of the function in lowercase. |
args | Optional arguments to use when calling the function. |
|
inlinevirtual |
Runs a nitro function by name with a set of arguments only if the method exists.
name | The name of the function in lowercase. |
context | The context to use for the 'this' value. |
args | The set of arguments to use when calling the function. |
optional | True if the method call is optional. No exception is thrown if not found. |
Reimplemented in PowerUI.NitroScriptEngine.
|
inline |
Runs a nitro function by name with a set of arguments.
name | The name of the function in lowercase. |
args | The set of arguments to use when calling the function. |
|
inline |
Runs a nitro function by name with a set of arguments.
name | The name of the function in lowercase. |
context | The context to use for the 'this' value. |
args | The set of arguments to use when calling the function. |
|
inline |
Runs a nitro function by name with a set of arguments only if the method exists.
name | The name of the function in lowercase. |
args | The set of arguments to use when calling the function. |
optional | True if the method call is optional. No exception is thrown if not found. |
|
inline |
Runs a nitro function by name with a set of arguments only if the method exists.
name | The name of the function in lowercase. |
context | The context to use for the 'this' value. |
optional | True if the method call is optional. No exception is thrown if not found. |
args | The set of arguments to use when calling the function. |
|
inline |
Runs a nitro function by name with a set of arguments only if the method exists.
name | The name of the function in lowercase. |
optional | True if the method call is optional. No exception is thrown if not found. |
args | The set of arguments to use when calling the function. |
|
inline |
Attempts to compile the code. It's only successful if there are no nulls in the code buffer.
string [] PowerUI.ScriptEngine.CodeBuffer |
All code in script tags is buffered and compiled in one go. This is the buffer.
Document PowerUI.ScriptEngine.Document |
The document this engine is for (if any).
|
get |
|
get |
The global scripting scope.
|
get |
The HTML document this engine is for (if any).
|
getset |
Gets or sets script variable values.
index | The name of the variable. |