Ketarin.Updater.Cancel C# (CSharp) Method

Cancel() public method

Cancels the updating progress.
public Cancel ( ) : void
return void
        public void Cancel()
        {
            m_CancelUpdates = true;
            lock (m_Requests)
            {
                foreach (WebRequest req in m_Requests)
                {
                    try
                    {
                        req.Abort();
                    }
                    catch (NotSupportedException)
                    {
                        continue;
                    }
                }
                m_Requests.Clear();
            }
        }

Usage Example

Example #1
0
 private void bRun_Click(object sender, EventArgs e)
 {
     if (m_Updater.IsBusy)
     {
         m_Updater.Cancel();
     }
     else
     {
         RunJobs(false, false, false);
     }
 }