Exemplo n.º 1
0
        /// <summary>
        /// disconnect from vpn
        /// </summary>
        /// <param name="closeForm">
        ///     close status window, this is important if you
        ///     change the configuration, because the status window will
        ///     still use the old configuration
        /// </param>
        public void Disconnect(bool closeForm)
        {
            // disconnect if needed
            if (m_vpn != null)
            {
                try
                {
                    m_vpn.Disconnect();
                }
                catch (InvalidOperationException)
                {
                }
            }

            if (m_frmpw != null)
            {
                m_frmpw.Invoke(new UtilsHelper.Action <Form>(closeSubForm), m_frmpw);
            }

            if (m_frmkey != null)
            {
                m_frmkey.Invoke(new UtilsHelper.Action <Form>(closeSubForm), m_frmkey);
            }

            if (m_frmlpw != null)
            {
                m_frmlpw.Invoke(new UtilsHelper.Action <Form>(closeSubForm), m_frmlpw);
            }

            // close the window if needed
            if (closeForm && m_status != null)
            {
                m_status.Close();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// disconnect from vpn
        /// </summary>
        /// <param name="closeForm">
        ///     close status window, this is important if you
        ///     change the configuration, because the status window will
        ///     still use the old configuration
        /// </param>
        public void Disconnect(bool closeForm)
        {
            // disconnect if needed
            if (VPNConnection != null)
            {
                try
                {
                    VPNConnection.Disconnect();
                }
                catch (InvalidOperationException)
                {
                }
            }

            if (m_frmlpw != null)
            {
                m_frmlpw.Invoke(new UtilsHelper.Action <Form>(closeSubForm), m_frmlpw);
            }
        }