예제 #1
0
 private void btnThoat_Click(object sender, EventArgs e)
 {
     if (m_BackgroundWorker.IsBusy)
     {
         m_BackgroundWorker.CurrentThread.Suspend();
         m_BackgroundWorker.StopImmediately();
     }
     this.Close();
 }
예제 #2
0
        public void StopTask()
        {
            SanitaLogEx.e(TAG, "Stop task...");

            try
            {
                if (m_BackgroundWorker.CurrentThread != null)
                {
                    m_BackgroundWorker.CurrentThread.Suspend();
                    m_BackgroundWorker.StopImmediately();
                }
            }
            catch (Exception ex)
            {
                SanitaLog.e(TAG, ex);
            }
        }
예제 #3
0
 private void btnThoat_Click(object sender, EventArgs e)
 {
     if (mWorker == null)
     {
         return;
     }
     try
     {
         if (MessageBox.Show("Are you sure you want to stop this task ?", "Message", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
         {
             mWorker.CurrentThread.Suspend();
             mWorker.StopImmediately();
             this.Close();
         }
     }
     catch (Exception ex)
     {
         //System.Windows.Forms.MessageBox.Toast(this, "Dừng tiến trình thất bại !");
     }
 }