//Calls the options form and checks if favorites or settings have changed //Visits a new URL if the user asked to visit a favorite / history website private void optionsButton_Click(object sender, EventArgs e) { Options opt = new Options(); previousUrl = actualUrl; opt.ShowDialog(); if (actualizeSettings) { browserName = ManageSettings.GetBrowserName(); this.Text = browserName; homeUrl = ManageSettings.GetHomeURL(); withHistory = ManageSettings.GetHistoryBoolean(); actualizeSettings = false; } if (actualizeFavsBar) { SetFavoritesBar(); actualizeFavsBar = false; } if (actualUrl != previousUrl) { WebBrowser web = tabControl.SelectedTab.Controls[0] as WebBrowser; if (web != null) { web.Navigate(actualUrl); } } }
private void InitializeBrowser() { ManageFavorites.Initialize(); ManageHistory.Initialize(); ManageSettings.Initialize(); SetFavoritesBar(); browserName = ManageSettings.GetBrowserName(); this.Text = browserName; homeUrl = ManageSettings.GetHomeURL(); withHistory = ManageSettings.GetHistoryBoolean(); webBrowser.Navigate(homeUrl); actualUrl = homeUrl; urlTextEdit.Text = homeUrl; tabControl.TabPages[0].Text = webBrowser.DocumentTitle; webBrowser.ScriptErrorsSuppressed = true; webBrowser.IsWebBrowserContextMenuEnabled = false; }