示例#1
0
        private void Dispose(bool disposing)
        {
            if (!disposed)
            {
                File.Delete(m_tempLog);

                if (disposing)
                {
                    m_disconnectTimer.Dispose();
                    m_frmkey.Dispose();
                    m_frmlpw.Dispose();
                    m_frmpw.Dispose();
                    m_infobox.Dispose();
                    m_menu.Dispose();
                    m_menu_connect.Dispose();
                    m_menu_disconnect.Dispose();
                    m_menu_edit.Dispose();
                    m_menu_error.Dispose();
                    m_menu_show.Dispose();
                    m_parent.Dispose();
                    m_status.Dispose();
                    m_vpn.Dispose();
                }

                m_vpn             = null;
                m_status          = null;
                m_parent          = null;
                m_menu_show       = null;
                m_menu_error      = null;
                m_menu_edit       = null;
                m_menu_disconnect = null;
                m_menu_connect    = null;
                m_menu            = null;
                m_infobox         = null;
                m_frmpw           = null;
                m_frmlpw          = null;
                m_frmkey          = null;
                m_disconnectTimer = null;

                disposed = true;
            }
        }
示例#2
0
        private void Dispose(bool disposing)
        {
            if (!disposed)
            {
                if (disposing)
                {
                    m_disconnectTimer.Dispose();
                    m_frmlpw.Dispose();
                    m_parent.Dispose();
                    VPNConnection.Dispose();
                }

                VPNConnection     = null;
                m_parent          = null;
                m_frmlpw          = null;
                m_disconnectTimer = null;

                disposed = true;
            }
        }
示例#3
0
        /// <summary>
        /// OVPN requests a username and password <br />
        /// generates and shows a form, answers via e
        /// </summary>
        /// <param name="sender">OVPN which requests the username and password</param>
        /// <param name="e">Information, what is needed</param>
        private void m_vpn_needLoginAndPassword(object sender, NeedLoginAndPasswordEventArgs e)
        {
            m_frmlpw = new FrmLoginAndPasswd();
            string[] loginfo = null;
            loginfo = m_frmlpw.AskLoginAndPass(e.PasswordType, Name);
            if (loginfo != null)
            {
                e.UserName = loginfo[0];
                e.Password = loginfo[1];
            }

            // if no password was entered, disconnect
            if ((e.Password == null || e.UserName == null) &&
                VPNConnection.State.CreateSnapshot().ConnectionState ==
                VPNConnectionState.Initializing)
            {
                m_disconnectTimer.Start();
            }

            m_frmlpw = null;
        }
示例#4
0
        private void Dispose(bool disposing)
        {
            if (!disposed)
            {
                if (disposing)
                {
                    m_disconnectTimer.Dispose();
                    m_frmkey.Dispose();
                    m_frmlpw.Dispose();
                    m_frmpw.Dispose();
                    m_infobox.Dispose();
                    m_menu.Dispose();
                    m_menu_connect.Dispose();
                    m_menu_disconnect.Dispose();
                    m_menu_edit.Dispose();
                    m_menu_error.Dispose();
                    m_menu_show.Dispose();
                    m_parent.Dispose();
                    m_status.Dispose();
                    m_vpn.Dispose();
                }

                m_vpn = null;
                m_status = null;
                m_parent = null;
                m_menu_show = null;
                m_menu_error = null;
                m_menu_edit = null;
                m_menu_disconnect = null;
                m_menu_connect = null;
                m_menu = null;
                m_infobox = null;
                m_frmpw = null;
                m_frmlpw = null;
                m_frmkey = null;
                m_disconnectTimer = null;

                disposed = true;
            }
        }
示例#5
0
        /// <summary>
        /// OVPN requests a username and password <br />
        /// generates and shows a form, answers via e
        /// </summary>
        /// <param name="sender">OVPN which requests the username and password</param>
        /// <param name="e">Information, what is needed</param>
        private void m_vpn_needLoginAndPassword(object sender, NeedLoginAndPasswordEventArgs e)
        {
            m_frmlpw = new FrmLoginAndPasswd();
            string[] loginfo = null;
            loginfo = m_frmlpw.AskLoginAndPass(e.PasswordType, Name);
            if (loginfo != null)
            {
                e.UserName = loginfo[0];
                e.Password = loginfo[1];
            }

            // if no password was entered, disconnect
            if ((e.Password == null || e.UserName == null) &&
                VPNConnection.State.CreateSnapshot().ConnectionState ==
                VPNConnectionState.Initializing)
            {
                m_disconnectTimer.Start();
            }

            m_frmlpw = null;
        }