The default script handler for Nitro.
Public Member Functions | |
override string[] | GetTypes () |
The meta types that your engine will handle. E.g. "text/javascript". More... | |
NitroScriptEngine () | |
override 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... | |
override 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... | |
Public Member Functions inherited from PowerUI.ScriptEngine | |
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... | |
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 | |
UICode | CodeInstance |
An instance of the compiled code on this page. May also be null of there is no script on the page. More... | |
Public Attributes inherited from PowerUI.ScriptEngine | |
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 | |
override void | Compile (string codeToCompile) |
Loads the given textual code for the given document. PowerUI ensures order for you including when scripts are downloaded from the internet. More... | |
Properties | |
override object | this[string global] [get, set] |
Gets or sets script variable values. More... | |
Properties inherited from PowerUI.ScriptEngine | |
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... | |
Private Attributes | |
NitroDomainManager | SecurityDomain |
The nitro securty domain for this document. More... | |
|
inline |
|
inlineprotectedvirtual |
Loads the given textual code for the given document. PowerUI ensures order for you including when scripts are downloaded from the internet.
Reimplemented from PowerUI.ScriptEngine.
|
inlinevirtual |
The meta types that your engine will handle. E.g. "text/javascript".
Reimplemented from PowerUI.ScriptEngine.
|
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 from PowerUI.ScriptEngine.
|
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 from PowerUI.ScriptEngine.
UICode PowerUI.NitroScriptEngine.CodeInstance |
An instance of the compiled code on this page. May also be null of there is no script on the page.
|
private |
The nitro securty domain for this document.
|
getset |
Gets or sets script variable values.
index | The name of the variable. |