/// <summary> /// connect button was pressed <br /> /// just connect via parent config /// </summary> /// <param name="sender">ignored</param> /// <param name="e">ignored</param> private void btnConnect_Click(object sender, EventArgs e) { VPNConnectionState state = m_config.VPNConnection.State.CreateSnapshot().ConnectionState; // connect only if we are disconnected, clear the list if (state == VPNConnectionState.Stopped || state == VPNConnectionState.Error) { //lstLog.Items.Clear(); m_config.Connect(); } // disconnect only if we are connected else if (state == VPNConnectionState.Initializing || state == VPNConnectionState.Running) { m_config.Disconnect(); } }
/// <summary> /// User wants to quit, exit application. /// </summary> /// <param name="sender">ignore</param> /// <param name="e">ignore</param> private void quitToolStripMenuItem_Click(object sender, EventArgs e) { m_config.Disconnect(); Close(); Application.Exit(); }