MsieJavaScriptEngine.JsRt.Native.JsSetRuntimeBeforeCollectCallback C# (CSharp) Method

JsSetRuntimeBeforeCollectCallback() private method

private JsSetRuntimeBeforeCollectCallback ( JavaScriptRuntime runtime, IntPtr callbackState, JavaScriptBeforeCollectCallback beforeCollectCallback ) : JavaScriptErrorCode
runtime JavaScriptRuntime
callbackState System.IntPtr
beforeCollectCallback JavaScriptBeforeCollectCallback
return JavaScriptErrorCode
        internal static extern JavaScriptErrorCode JsSetRuntimeBeforeCollectCallback(JavaScriptRuntime runtime, IntPtr callbackState, JavaScriptBeforeCollectCallback beforeCollectCallback);

Usage Example

Ejemplo n.º 1
0
 /// <summary>
 /// Sets a callback function that is called by the runtime before garbage collection.
 /// </summary>
 /// <remarks>
 /// <para>
 /// The callback is invoked on the current runtime execution thread, therefore execution is
 /// blocked until the callback completes.
 /// </para>
 /// <para>
 /// The callback can be used by hosts to prepare for garbage collection. For example, by
 /// releasing unnecessary references on Chakra objects.
 /// </para>
 /// </remarks>
 /// <param name="callbackState">
 /// User provided state that will be passed back to the callback.
 /// </param>
 /// <param name="beforeCollectCallback">The callback function being set.</param>
 public void SetBeforeCollectCallback(IntPtr callbackState, JavaScriptBeforeCollectCallback beforeCollectCallback)
 {
     Native.ThrowIfError(Native.JsSetRuntimeBeforeCollectCallback(this, callbackState, beforeCollectCallback));
 }
Native