示例#1
0
        /*public static void SetBeforeObjectCollectionCallback()
         * {
         * Native.JsSetObjectBeforeCollectCallback(JavaScriptValue reference, IntPtr callbackState, JavaScriptObjectBeforeCollectCallback beforeCollectCallback);
         * }*/

        /// <summary>
        ///     Disposes a runtime.
        /// </summary>
        /// <remarks>
        ///     Once a runtime has been disposed, all resources owned by it are invalid and cannot be used.
        ///     If the runtime is active (i.e. it is set to be current on a particular thread), it cannot
        ///     be disposed.
        /// </remarks>
        public void Dispose()
        {
            if (IsValid)
            {
                Native.ThrowIfError(Native.JsDisposeRuntime(this));
            }

            handle = IntPtr.Zero;
        }
        /// <summary>
        ///     Disposes a runtime.
        /// </summary>
        /// <remarks>
        ///     Once a runtime has been disposed, all resources owned by it are invalid and cannot be used.
        ///     If the runtime is active (i.e. it is set to be current on a particular thread), it cannot
        ///     be disposed.
        /// </remarks>
        public void Dispose()
        {
            if (IsValid)
            {
                Native.ThrowIfError(Native.JsSetCurrentContext(JavaScriptContext.Invalid));
                Native.ThrowIfError(Native.JsDisposeRuntime(this));
            }

            handle = IntPtr.Zero;
        }