Esempio n. 1
0
        private void miRunBackground_Click(object sender, EventArgs e)
        {
            RunBackgroundEventArgs runEventArgs = new RunBackgroundEventArgs(RunBackgroundState.GoOn);

            _bWillRunBackground = true;
            RunBackground(this, runEventArgs);
        }
Esempio n. 2
0
 private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (e.CloseReason == CloseReason.UserClosing && !_bWillRunBackground)
     {
         if (MessageHandle.MessageAsk("确定要退出系统?", "确定退出") == DialogResult.Cancel)
         {
             e.Cancel = true;
         }
         else
         {
             RunBackgroundEventArgs runEventArgs = new RunBackgroundEventArgs(RunBackgroundState.Exit);
             RunBackground(this, runEventArgs);
         }
     }
 }