C# Class Rhino.Commonjs.Module.RequireBuilder

Datei anzeigen Open project: hazzik/Rhino.Net Class Usage Examples

Public Methods

Method Description
CreateRequire ( Context cx, Scriptable globalScope ) : Require

Creates a new require() function.

Creates a new require() function. You are still responsible for invoking either Require.Install(Rhino.Scriptable) or Require.RequireMain(Rhino.Context, string) to effectively make it available to its JavaScript program.

SetModuleScriptProvider ( ModuleScriptProvider moduleScriptProvider ) : RequireBuilder

Sets the ModuleScriptProvider for the Require instances that this builder builds.

SetPostExec ( Script postExec ) : RequireBuilder

Sets the script that should execute in every module's scope after the module's own script has executed.

Sets the script that should execute in every module's scope after the module's own script has executed.

SetPreExec ( Script preExec ) : RequireBuilder

Sets the script that should execute in every module's scope before the module's own script has executed.

Sets the script that should execute in every module's scope before the module's own script has executed.

SetSandboxed ( bool sandboxed ) : RequireBuilder

Sets whether the created require() instances will be sandboxed.

Sets whether the created require() instances will be sandboxed. See Require.Require(Rhino.Context, Rhino.Scriptable, ModuleScriptProvider, Rhino.Script, Rhino.Script, bool) for explanation.

Method Details

CreateRequire() public method

Creates a new require() function.
Creates a new require() function. You are still responsible for invoking either Require.Install(Rhino.Scriptable) or Require.RequireMain(Rhino.Context, string) to effectively make it available to its JavaScript program.
public CreateRequire ( Context cx, Scriptable globalScope ) : Require
cx Rhino.Context the current context
globalScope Scriptable the global scope containing the JS standard natives.
return Require

SetModuleScriptProvider() public method

Sets the ModuleScriptProvider for the Require instances that this builder builds.
public SetModuleScriptProvider ( ModuleScriptProvider moduleScriptProvider ) : RequireBuilder
moduleScriptProvider ModuleScriptProvider /// the module script provider for the /// Require /// instances that this builder builds. ///
return RequireBuilder

SetPostExec() public method

Sets the script that should execute in every module's scope after the module's own script has executed.
Sets the script that should execute in every module's scope after the module's own script has executed.
public SetPostExec ( Script postExec ) : RequireBuilder
postExec Script the post-exec script.
return RequireBuilder

SetPreExec() public method

Sets the script that should execute in every module's scope before the module's own script has executed.
Sets the script that should execute in every module's scope before the module's own script has executed.
public SetPreExec ( Script preExec ) : RequireBuilder
preExec Script the pre-exec script.
return RequireBuilder

SetSandboxed() public method

Sets whether the created require() instances will be sandboxed.
Sets whether the created require() instances will be sandboxed. See Require.Require(Rhino.Context, Rhino.Scriptable, ModuleScriptProvider, Rhino.Script, Rhino.Script, bool) for explanation.
public SetSandboxed ( bool sandboxed ) : RequireBuilder
sandboxed bool /// true if the created require() instances will be /// sandboxed. ///
return RequireBuilder