C# Class MsieJavaScriptEngine.ActiveScript.ActiveScriptParseWrapper

Inheritance: IActiveScriptParseWrapper
ファイルを表示 Open project: Taritsyn/MsieJavaScriptEngine

Public Methods

Method Description
ActiveScriptParseWrapper ( IntPtr pActiveScript, IActiveScript activeScript ) : System

Constructs instance of the ActiveScriptParseWrapper class

AddScriptlet ( string defaultName, string code, string itemName, string subItemName, string eventName, string delimiter, IntPtr sourceContextCookie, uint startingLineNumber, ScriptTextFlags flags ) : string

Adds a code scriptlet to the script. This method is used in environments where the persistent state of the script is intertwined with the host document and the host is responsible for restoring the script, rather than through an IPersist* interface. The primary examples are HTML scripting languages that allow scriptlets of code embedded in the HTML document to be attached to intrinsic events (for instance, ONCLICK="button1.text='Exit'").

Dispose ( ) : void

Destroys object

InitNew ( ) : void

Initializes the scripting engine

ParseScriptText ( string code, string itemName, object context, string delimiter, IntPtr sourceContextCookie, uint startingLineNumber, ScriptTextFlags flags ) : object

Parses the given code scriptlet, adding declarations into the namespace and evaluating code as appropriate.

Private Methods

Method Description
Dispose ( bool disposing ) : void

Destroys object

Method Details

ActiveScriptParseWrapper() public method

Constructs instance of the ActiveScriptParseWrapper class
public ActiveScriptParseWrapper ( IntPtr pActiveScript, IActiveScript activeScript ) : System
pActiveScript System.IntPtr Pointer to an instance of native JavaScript engine
activeScript IActiveScript Instance of native JavaScript engine. /// Must implement IActiveScriptParse32 or IActiveScriptParse64.
return System

AddScriptlet() public method

Adds a code scriptlet to the script. This method is used in environments where the persistent state of the script is intertwined with the host document and the host is responsible for restoring the script, rather than through an IPersist* interface. The primary examples are HTML scripting languages that allow scriptlets of code embedded in the HTML document to be attached to intrinsic events (for instance, ONCLICK="button1.text='Exit'").
public AddScriptlet ( string defaultName, string code, string itemName, string subItemName, string eventName, string delimiter, IntPtr sourceContextCookie, uint startingLineNumber, ScriptTextFlags flags ) : string
defaultName string The default name to associate with the scriptlet. If the /// scriptlet does not contain naming information (as in the ONCLICK example above), /// this name will be used to identify the scriptlet. If this parameter is NULL, the /// scripting engine manufactures a unique name, if necessary.
code string The scriptlet text to add. The interpretation of this string /// depends on the scripting language.
itemName string The item name associated with this scriptlet. This parameter, /// in addition to pstrSubItemName, identifies the object for which the scriptlet is /// an event handler.
subItemName string The name of a subobject of the named item with which this /// scriptlet is associated; this name must be found in the named item's type /// information. This parameter is NULL if the scriptlet is to be associated with the /// named item instead of a subitem. This parameter, in addition to pstrItemName, /// identifies the specific object for which the scriptlet is an event handler.
eventName string The name of the event for which the scriptlet is an event /// handler.
delimiter string The end-of-scriptlet delimiter. When the pstrCode parameter /// is parsed from a stream of text, the host typically uses a delimiter, such as two /// single quotation marks (''), to detect the end of the scriptlet. This parameter /// specifies the delimiter that the host used, allowing the scripting engine to /// provide some conditional primitive preprocessing (for example, replacing a single /// quotation mark ['] with two single quotation marks for use as a delimiter). /// Exactly how (and if) the scripting engine makes use of this information depends /// on the scripting engine. Set this parameter to NULL if the host did not use a /// delimiter to mark the end of the scriptlet.
sourceContextCookie System.IntPtr Application-defined value that is used for /// debugging purposes
startingLineNumber uint Zero-based value that specifies which line the /// parsing will begin at
flags ScriptTextFlags Flags associated with the scriptlet
return string

Dispose() public method

Destroys object
public Dispose ( ) : void
return void

InitNew() public method

Initializes the scripting engine
public InitNew ( ) : void
return void

ParseScriptText() public method

Parses the given code scriptlet, adding declarations into the namespace and evaluating code as appropriate.
public ParseScriptText ( string code, string itemName, object context, string delimiter, IntPtr sourceContextCookie, uint startingLineNumber, ScriptTextFlags flags ) : object
code string The scriptlet text to evaluate. The interpretation of this /// string depends on the scripting language
itemName string The item name that gives the context in which the /// scriptlet is to be evaluated. If this parameter is NULL, the code is evaluated /// in the scripting engine's global context
context object The context object. This object is reserved for use in a /// debugging environment, where such a context may be provided by the debugger to /// represent an active run-time context. If this parameter is NULL, the engine /// uses pstrItemName to identify the context.
delimiter string The end-of-scriptlet delimiter. When pstrCode is parsed /// from a stream of text, the host typically uses a delimiter, such as two single /// quotation marks (''), to detect the end of the scriptlet. This parameter specifies /// the delimiter that the host used, allowing the scripting engine to provide some /// conditional primitive preprocessing (for example, replacing a single quotation /// mark ['] with two single quotation marks for use as a delimiter). Exactly how /// (and if) the scripting engine makes use of this information depends on the /// scripting engine. Set this parameter to NULL if the host did not use a delimiter /// to mark the end of the scriptlet.
sourceContextCookie System.IntPtr Application-defined value that is used for /// debugging purposes
startingLineNumber uint Zero-based value that specifies which line the /// parsing will begin at
flags ScriptTextFlags Flags associated with the scriptlet
return object