private void CloseApplication() { Hide(); notify.Visible = false; ActiveController.SoftKill(true); Environment.Exit(0); }
private void OpenVpnSwitch(string config, bool ask = true) { if (ask && ActiveController.IsRunning && (!ActiveController.IsRunning || MessageBox.Show("Do you want to disconnect from the current server and connect to this one?", "Reconnect", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)) { return; } if (ActiveController.IsRunning) { ActiveController.SoftKill(true); } ActiveController.Run(config, InternalData.SettingsGrid.Username, InternalData.SettingsGrid.Password); }
private void functionButton_Click(object sender, EventArgs e) { if (ActiveController.IsRunning) { ActiveController.SoftKill(); } else { if (serverView.SelectedItems.Count > 0) { ConnectToSelected(); } else { AutoConnect(); } } }
private void disconnectToolStripMenuItem_Click(object sender, EventArgs e) { ActiveController.SoftKill(); }