/// <summary> /// Disconnects from the OpenVPN Service. /// </summary> /// <seealso cref="Connect"/> public override void Disconnect() { StateSnapshot ss = State.CreateSnapshot(); if (ss.ConnectionState == VPNConnectionState.Stopped || State.ConnectionState == VPNConnectionState.Error) { State.ChangeState(VPNConnectionState.Stopped); return; } State.ChangeState(VPNConnectionState.Stopping); var del = new UtilsHelper.Action(killConnection); del.BeginInvoke(null, null); }
/// <summary> /// Generates the new object. /// </summary> /// <param name="newState">The snapshot to return</param> internal StateChangedEventArgs(StateSnapshot newState) { m_state = newState; }