private void Window_Closed(object sender, System.EventArgs e) { Window.Closed -= Window_Closed; _ChromeWidgetMessageInterceptor?.ReleaseHandle(); _ChromeWidgetMessageInterceptor?.DestroyHandle(); _ChromeWidgetMessageInterceptor = null; }
private void Window_Closed(object sender, System.EventArgs e) { _Window.Closed -= Window_Closed; _Window.LocationChanged -= _Window_LocationChanged; _Window.StateChanged -= Window_StateChanged; _ChromeWidgetMessageInterceptor?.ReleaseHandle(); _ChromeWidgetMessageInterceptor?.DestroyHandle(); _ChromeWidgetMessageInterceptor = null; }
private async void ChromiumWebBrowser_BrowserCreated(object sender, Chromium.WebBrowser.Event.BrowserCreatedEventArgs e) { _BrowserHandle = e.Browser.Host.WindowHandle; var resilientGetHandle = new Resilient(() => ChromeWidgetHandleFinder.TryFindHandle(_BrowserHandle, out _ChromeWidgetHostHandle)); await resilientGetHandle.WithTimeOut(100).StartIn(100); _ChromeWidgetMessageInterceptor = new BrowserWidgetMessageInterceptor(this.ChromiumWebBrowser, _ChromeWidgetHostHandle, OnWebBroswerMessage); }