Beispiel #1
0
        /// <summary>
        /// Post a task for execution on the thread associated with this task runner.
        /// Execution will occur asynchronously.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_task_capi.h">cef/include/capi/cef_task_capi.h</see>.
        /// </remarks>
        public bool PostTask(CfrTask task)
        {
            var call = new CfxTaskRunnerPostTaskRemoteCall();

            call.@this = RemotePtr.ptr;
            call.task  = CfrObject.Unwrap(task).ptr;
            call.RequestExecution(RemotePtr.connection);
            return(call.__retval);
        }
        /// <summary>
        /// Post a task for execution on the thread associated with this task runner.
        /// Execution will occur asynchronously.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_task_capi.h">cef/include/capi/cef_task_capi.h</see>.
        /// </remarks>
        public bool PostTask(CfrTask task)
        {
            var connection = RemotePtr.connection;
            var call       = new CfxTaskRunnerPostTaskRemoteCall();

            call.@this = RemotePtr.ptr;
            if (!CfrObject.CheckConnection(task, connection))
            {
                throw new ArgumentException("Render process connection mismatch.", "task");
            }
            call.task = CfrObject.Unwrap(task).ptr;
            call.RequestExecution(connection);
            return(call.__retval);
        }