Пример #1
0
        private void RestoreForm()
        {
            ntfyMinimize.Visible = false;

            if (Base.pw != string.Empty)
            {
                using (frmPw dlg = new frmPw())
                {
                    dlg.cboxCloseVisible = false;
                    dlg.ShowDialog(this);
                }
            }
            this.Show();
            //this.WindowState = FormWindowState.Normal;

            ShowWindows();
        }
Пример #2
0
 private void AdminPwGetCompleted(Object sender, krw.AdminPwGetCompletedEventArgs Completed)
 {
     try
     {
         string pw = Completed.Result;
         switch (pw.Substring(0, Base.srvMsgLen))
         {
             case Base.srvMsgSuccess:
                 pw = pw.Substring(Base.srvMsgLen);
                 Base.pw = pw;
                 if (pw != string.Empty)
                 {
                     using (frmPw dlg = new frmPw())
                     {
                         dlg.cboxCloseVisible = true;
                         dlg.ShowDialog(this);
                         if (dlg.isValid)
                             ShowGUI();
                         else
                             //Password is inavlid - User closed the form
                             ShutItDown();
                     }
                 }
                 else
                     ShowGUI();
                 break;
             case Base.srvMsgErr:
                 //An erorr ocurred
                 pw = pw.Substring(Base.srvMsgLen);
                 if (pw == Base.srvMsgInvalidLegal)
                 {
                     MessageBox.Show(this, Base.errPrefix + pw, Base.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
                     ShutItDown();
                 }
                 else
                 {
                     TryRequest("AdminPwGet", pw);
                     return;
                 }
                 break;
             default:
                 break;
         }
     }
     catch (SoapException ex)
     {
         TryRequest("AdminPwGet", ex.Message + "\n\n" + ex.InnerException.Message);
     }
     catch (Exception ex)
     {
         TryRequest("AdminPwGet", ex.Message + "\n\n" + ex.InnerException.Message);
     }
     finally
     {
     }
 }
Пример #3
0
        private void DoProtect()
        {
            if (Base.pw != string.Empty)
            {
                HideWindows();

                this.Hide();
                using (frmPw dlg = new frmPw())
                {
                    dlg.cboxCloseVisible = false;
                    dlg.ShowDialog(this);
                    this.Show();

                    ShowWindows();
                }
            }
        }