JsCreateContext() private method

private JsCreateContext ( IeJsRuntime runtime, IDebugApplication32 debugSite, IeJsContext &newContext ) : JsErrorCode
runtime IeJsRuntime
debugSite IDebugApplication32
newContext IeJsContext
return JsErrorCode
コード例 #1
0
        /// <summary>
        /// Creates a script context for running scripts
        /// </summary>
        /// <remarks>
        /// Each script context has its own global object that is isolated from all other script
        /// contexts.
        /// </remarks>
        /// <returns>The created script context</returns>
        public IeJsContext CreateContext()
        {
            IeJsContext reference;

            IeJsErrorHelpers.ThrowIfError(Utils.Is64BitProcess() ?
                                          IeNativeMethods.JsCreateContext(this, (IDebugApplication64)null, out reference)
                                :
                                          IeNativeMethods.JsCreateContext(this, (IDebugApplication32)null, out reference)
                                          );

            return(reference);
        }
コード例 #2
0
        /// <summary>
        /// Creates a debug script context for running scripts
        /// </summary>
        /// <remarks>
        /// Each script context has its own global object that is isolated from all other script
        /// contexts.
        /// </remarks>
        /// <param name="debugApplication">The debug application to use</param>
        /// <returns>The created script context</returns>
        public IeJsContext CreateContext(IDebugApplication32 debugApplication)
        {
            IeJsContext reference;

            if (Utils.Is64BitProcess())
            {
                throw new InvalidOperationException();
            }
            IeJsErrorHelpers.ThrowIfError(IeNativeMethods.JsCreateContext(this, debugApplication, out reference));

            return(reference);
        }