예제 #1
0
        private void mnuLogOff_Click(object sender, System.EventArgs e)
        {
            frmLogOff DR = new frmLogOff();
            DR.ShowDialog(this);
            if(DR.DialogResult == DialogResult.Cancel)
            {
                return;
            }

            if(OSystem != null)
                OSystem.ReleaseResources();
            //            if(LoginUser != null)
            //                LoginUser.ReleaseCameras();
            if(FRMHelp != null)
            {
                if(FRMHelp.Visible == false)
                {
                    FRMHelp = new frmHelp();
                    FRMHelp.Dispose();
                }
                else
                    FRMHelp.Dispose();
            }
            DR.Dispose();
            g_bAppClosing = true;
            Application.Exit();
            //this.DialogResult = DialogResult.Cancel;
        }
예제 #2
0
파일: Form1.cs 프로젝트: CarverLab/Oyster
        private void Form1_Closing_1(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if(g_bAppClosing == false)
            {
                frmLogOff DR = new frmLogOff();
                DR.ShowDialog(this);
                if(DR.DialogResult == DialogResult.Cancel)
                {
                    e.Cancel = true;
                    return;
                }
                UserLicense.Release();
                if(OSystem != null)
                    OSystem.ReleaseResources();
                //                if(LoginUser != null)
                //                    LoginUser.ReleaseCameras();

                if(FRMHelp != null)
                {
                    if(FRMHelp.Visible == false)
                    {
                        FRMHelp = new frmHelp();
                        FRMHelp.Dispose();
                    }
                    else
                        FRMHelp.Dispose();
                }
                DR.Dispose();
            }

            Trace.WriteLine("Logged Off",System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName + "." + System.Reflection.MethodBase.GetCurrentMethod().Name);

            Application.Exit();
            //this.DialogResult = DialogResult.Cancel;
        }