C# Класс MsieJavaScriptEngine.ActiveScript.ActiveScriptSiteWrapper

Наследование: IActiveScriptSite, IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
ActiveScriptSiteWrapper ( IntPtr pActiveScript, IActiveScript activeScript ) : System

Constructs instance of ActiveScriptSiteWrapper

ActiveScriptSiteWrapper ( IntPtr pActiveScript, IActiveScript activeScript, string documentVersion ) : System

Constructs instance of ActiveScriptSiteWrapper

CallFunction ( string functionName ) : object

Calls a function

DeleteProperty ( string propertyName ) : void

Removes a global object property

Dispose ( ) : void

Destroys object

ExecuteScriptText ( string code, bool isExpression ) : object

Executes a script text

GetDocVersionString ( string &version ) : void

Retrieves a host-defined string that uniquely identifies the current document version. If the related document has changed outside the scope of Windows Script (as in the case of an HTML page being edited with Notepad), the scripting engine can save this along with its persisted state, forcing a recompile the next time the script is loaded.

GetItemInfo ( string name, ScriptInfoFlags returnMask, object &item, IntPtr &pTypeInfo ) : void

Allows the scripting engine to obtain information about an item added with the IActiveScript.AddNamedItem method

GetLcid ( int &lcid ) : void

Retrieves the locale identifier associated with the host's user interface. The scripting engine uses the identifier to ensure that error strings and other user-interface elements generated by the engine appear in the appropriate language.

GetProperty ( string propertyName ) : object

Gets a value of global object property

HasProperty ( string propertyName ) : bool

Сhecks for the existence of a global object property

OnEnterScript ( ) : void

Informs the host that the scripting engine has begun executing the script code

OnLeaveScript ( ) : void

Informs the host that the scripting engine has returned from executing script code

OnScriptError ( IActiveScriptError scriptError ) : void

Informs the host that an execution error occurred while the engine was running the script.

OnScriptTerminate ( object result, System.Runtime.InteropServices.ComTypes.EXCEPINFO exceptionInfo ) : void

Informs the host that the script has completed execution

OnStateChange ( ScriptState scriptState ) : void

Informs the host that the scripting engine has changed states

SetProperty ( string propertyName, object value ) : void

Sets a value to global object property

Защищенные методы

Метод Описание
OnScriptError ( ActiveScriptException exception ) : void

Informs the host that an execution error occurred while the engine was running the script

Приватные методы

Метод Описание
Dispose ( bool disposing ) : void

Destroys object

GetAndResetLastException ( ) : ActiveScriptException

Gets and resets a last exception. Returns null for none.

GetItem ( string name ) : object

Allows the scripting engine to obtain information about an item added with the IActiveScript.AddNamedItem method

GetTypeInfo ( string name ) : IntPtr

Allows the scripting engine to obtain information about an item added with the IActiveScript.AddNamedItem method. Gets the COM ITypeInfo

InitScriptDispatch ( ) : void

Initializes a script dispatch

ThrowError ( ) : void

Описание методов

ActiveScriptSiteWrapper() публичный Метод

Constructs instance of ActiveScriptSiteWrapper
public ActiveScriptSiteWrapper ( IntPtr pActiveScript, IActiveScript activeScript ) : System
pActiveScript System.IntPtr Pointer to an instance of native JavaScript engine
activeScript IActiveScript Instance of native JavaScript engine
Результат System

ActiveScriptSiteWrapper() публичный Метод

Constructs instance of ActiveScriptSiteWrapper
public ActiveScriptSiteWrapper ( IntPtr pActiveScript, IActiveScript activeScript, string documentVersion ) : System
pActiveScript System.IntPtr Pointer to an instance of native JavaScript engine
activeScript IActiveScript Instance of native JavaScript engine
documentVersion string Host-defined document version string
Результат System

CallFunction() публичный Метод

Calls a function
public CallFunction ( string functionName ) : object
functionName string Function name
Результат object

DeleteProperty() публичный Метод

Removes a global object property
public DeleteProperty ( string propertyName ) : void
propertyName string Name of property
Результат void

Dispose() публичный Метод

Destroys object
public Dispose ( ) : void
Результат void

ExecuteScriptText() публичный Метод

Executes a script text
public ExecuteScriptText ( string code, bool isExpression ) : object
code string Script text
isExpression bool Flag that script text needs to run as an expression
Результат object

GetDocVersionString() публичный Метод

Retrieves a host-defined string that uniquely identifies the current document version. If the related document has changed outside the scope of Windows Script (as in the case of an HTML page being edited with Notepad), the scripting engine can save this along with its persisted state, forcing a recompile the next time the script is loaded.
public GetDocVersionString ( string &version ) : void
version string The host-defined document version string
Результат void

GetItemInfo() публичный Метод

Allows the scripting engine to obtain information about an item added with the IActiveScript.AddNamedItem method
public GetItemInfo ( string name, ScriptInfoFlags returnMask, object &item, IntPtr &pTypeInfo ) : void
name string The name associated with the item, as specified in the /// IActiveScript.AddNamedItem method
returnMask ScriptInfoFlags A bit mask specifying what information about the item should be /// returned. The scripting engine should request the minimum amount of information possible /// because some of the return parameters (for example, ITypeInfo) can take considerable /// time to load or generate
item object A variable that receives a pointer to the IUnknown interface associated /// with the given item. The scripting engine can use the IUnknown.QueryInterface method to /// obtain the IDispatch interface for the item. This parameter receives null if returnMask /// does not include the ScriptInfo.IUnknown value. Also, it receives null if there is no /// object associated with the item name; this mechanism is used to create a simple class when /// the named item was added with the ScriptItem.CodeOnly flag set in the /// IActiveScript.AddNamedItem method.
pTypeInfo System.IntPtr A variable that receives a pointer to the ITypeInfo interface /// associated with the item. This parameter receives null if returnMask does not include the /// ScriptInfo.ITypeInfo value, or if type information is not available for this item. If type /// information is not available, the object cannot source events, and name binding must be /// realized with the IDispatch.GetIDsOfNames method. Note that the ITypeInfo interface /// retrieved describes the item's coclass (TKIND_COCLASS) because the object may support /// multiple interfaces and event interfaces. If the item supports the IProvideMultipleTypeInfo /// interface, the ITypeInfo interface retrieved is the same as the index zero ITypeInfo that /// would be obtained using the IProvideMultipleTypeInfo.GetInfoOfIndex method.
Результат void

GetLcid() публичный Метод

Retrieves the locale identifier associated with the host's user interface. The scripting engine uses the identifier to ensure that error strings and other user-interface elements generated by the engine appear in the appropriate language.
public GetLcid ( int &lcid ) : void
lcid int A variable that receives the locale identifier for user-interface /// elements displayed by the scripting engine
Результат void

GetProperty() публичный Метод

Gets a value of global object property
public GetProperty ( string propertyName ) : object
propertyName string Name of property
Результат object

HasProperty() публичный Метод

Сhecks for the existence of a global object property
public HasProperty ( string propertyName ) : bool
propertyName string Name of property
Результат bool

OnEnterScript() публичный Метод

Informs the host that the scripting engine has begun executing the script code
public OnEnterScript ( ) : void
Результат void

OnLeaveScript() публичный Метод

Informs the host that the scripting engine has returned from executing script code
public OnLeaveScript ( ) : void
Результат void

OnScriptError() защищенный Метод

Informs the host that an execution error occurred while the engine was running the script
protected OnScriptError ( ActiveScriptException exception ) : void
exception ActiveScriptException The exception
Результат void

OnScriptError() публичный Метод

Informs the host that an execution error occurred while the engine was running the script.
public OnScriptError ( IActiveScriptError scriptError ) : void
scriptError IActiveScriptError A host can use this interface to obtain information about the /// execution error
Результат void

OnScriptTerminate() публичный Метод

Informs the host that the script has completed execution
public OnScriptTerminate ( object result, System.Runtime.InteropServices.ComTypes.EXCEPINFO exceptionInfo ) : void
result object A variable that contains the script result, or null if the script /// produced no result
exceptionInfo System.Runtime.InteropServices.ComTypes.EXCEPINFO Contains exception information generated when the script /// terminated, or null if no exception was generated
Результат void

OnStateChange() публичный Метод

Informs the host that the scripting engine has changed states
public OnStateChange ( ScriptState scriptState ) : void
scriptState ScriptState Indicates the new script state
Результат void

SetProperty() публичный Метод

Sets a value to global object property
public SetProperty ( string propertyName, object value ) : void
propertyName string Name of property
value object Value of property
Результат void