Пример #1
0
        private void signOut_Clicked(object sender, RoutedEventArgs e)
        {
            Properties.Settings.Default.password = "";
            Properties.Settings.Default.username = "";
            Properties.Settings.Default.Save();

            //connectionTimer.Stop();
            connectionAttempts = -1;

            new System.Threading.Thread(() =>
            {
                if (vpnControl.isConnected())
                {
                    vpnControl.disconnectFromVPN();
                    vpnControl.UnsetDNS();
                }

                vpnControl.removeVPN();
            }).Start();

            notifyIcon.Visible = false;
            this.Hide();

            if (vpnSettings != null && vpnSettings.IsLoaded)
            {
                vpnSettings.Close();
            }

            handleLoginForm(true);
        }