private void InitExternalBrowsersCommandIds() { foreach (var browserTag in ExternalBrowserManager.AvailableBrowsers.Keys) { switch (browserTag) { case ExternalBrowserManager.BrowserChromeTag: _commandIdOpenChrome = CommandIds.RegisterUserCommand(ExternalBrowserManager.BrowserChromeTag); _externalBrowsersCommandIds.Add("Open in Chrome", _commandIdOpenChrome); break; case ExternalBrowserManager.BrowserFirefoxTag: _commandIdOpenFirefox = CommandIds.RegisterUserCommand(ExternalBrowserManager.BrowserFirefoxTag); _externalBrowsersCommandIds.Add("Open in Firefox", _commandIdOpenFirefox); break; case ExternalBrowserManager.BrowserIETag: _commandIdOpenIE = CommandIds.RegisterUserCommand(ExternalBrowserManager.BrowserIETag); _externalBrowsersCommandIds.Add("Open in Internet Explorer", _commandIdOpenIE); break; case ExternalBrowserManager.BrowserEdgeTag: _commandIdOpenEdge = CommandIds.RegisterUserCommand(ExternalBrowserManager.BrowserEdgeTag); _externalBrowsersCommandIds.Add("Open in Edge", _commandIdOpenEdge); break; } } }
private void InitBrowser() { _idCommandDownload = CommandIds.RegisterUserCommand("DownloadImage"); _idCommandEdit = CommandIds.RegisterUserCommand("EditImage"); _idCommandAddToFavorites = CommandIds.RegisterUserCommand("AddToFavorites"); _idCommandAddAllToFavorites = CommandIds.RegisterUserCommand("AddAllToFavorites"); _browser = new WebControl(); Controls.Add(_browser); _browser.WebView = new WebView(); _browser.Dock = DockStyle.Fill; _browser.WebView.LoadCompleted += WebView_LoadComplete; _browser.WebView.BeforeContextMenu += WebView_BeforeContextMenu; _browser.WebView.Command += WebView_Command; }