コード例 #1
0
 private void RegisterHandlers()
 {
     _handlerTokenDictionary.Add(HandlerType.NavigationComplete, _webView2WebView.RegisterNavigationCompleted(OnNavigationCompleted));
     _handlerTokenDictionary.Add(HandlerType.NavigationStarting, _webView2WebView.RegisterNavigationStarting(OnNavigationStarting));
     _handlerTokenDictionary.Add(HandlerType.ZoomFactorChanged, _webView2WebView.RegisterZoomFactorChanged(OnZoomFactorChanged));
     _handlerTokenDictionary.Add(HandlerType.WebMessageReceived, _webView2WebView.RegisterWebMessageReceived(OnWebMessageRecieved));
     _handlerTokenDictionary.Add(HandlerType.DocumentStateChanged, _webView2WebView.RegisterDocumentStateChanged(OnDocumentStateChanged));
     _handlerTokenDictionary.Add(HandlerType.LostFocus, _webView2WebView.RegisterLostFocus(OnBrowserLostFocus));
     _handlerTokenDictionary.Add(HandlerType.FrameNavigationStarting, _webView2WebView.RegisterFrameNavigationStarting(OnFrameNavigationStarting));
     _handlerTokenDictionary.Add(HandlerType.MoveFocusRequested, _webView2WebView.RegisterMoveFocusRequested(OnMoveFocusRequested));
     _handlerTokenDictionary.Add(HandlerType.GotFocus, _webView2WebView.RegisterGotFocus(OnBrowserGotFocus));
     _handlerTokenDictionary.Add(HandlerType.WebResourceRequested, _webView2WebView.RegisterWebResourceRequested(OnWebResourceRequested));
     _handlerTokenDictionary.Add(HandlerType.ScriptDialogOpening, _webView2WebView.RegisterScriptDialogOpening(OnScriptDialogOpening));
     _handlerTokenDictionary.Add(HandlerType.PermissionRequested, _webView2WebView.RegisterPermissionRequested(OnPermissionRequested));
     _handlerTokenDictionary.Add(HandlerType.ProcessFailed, _webView2WebView.RegisterProcessFailed(OnProcessFailed));
     _handlerTokenDictionary.Add(HandlerType.TitleChanged, _webView2WebView.RegisterDocumentTitledChanged(OnDocumentTitleChanged));
     _handlerTokenDictionary.Add(HandlerType.NewWindow, _webView2WebView.RegisterNewWindowRequested(OnNewWindowRequested));
     _handlerTokenDictionary.Add(HandlerType.AcceleratorKeyPressed, _webView2WebView.RegisterAcceleratorKeyPressed(OnAcceleratorKeyPressed));
     _handlerTokenDictionary.Add(HandlerType.FullScreenElement, _webView2WebView.RegisterContainsFullScreenElementChanged(OnContainsFullScreenElementChanged));
     _handlersRegistered = true;
 }