用户响应后执行回调的示例是什么

时间:2018-09-27 20:55:20

标签: winforms cefsharp

以下是CefSharp示例(link)中OnBeforeUnloadDialog的处理程序方法。 用户响应后执行回调是什么意思?

        bool IJsDialogHandler.OnBeforeUnloadDialog(IWebBrowser browserControl, IBrowser browser, string message, bool isReload, IJsDialogCallback callback)
    {
        //Custom implementation would look something like
        // - Create/Show dialog on UI Thread
        // - execute callback once user has responded
        // - callback.Continue(true);
        // - return true

        //NOTE: Returning false will trigger the default behaviour, no need to execute the callback if you return false.
        return false;

}

0 个答案:

没有答案