public static void Update(string text, int amount, bool continuous = false)
 {
     if (ProgressForm.InvokeRequired)
     {
         ProgressForm.Invoke((MethodInvoker) delegate {
             ProgressForm.UpdateProgressBar(text, amount, continuous);
         });
     }
     else
     {
         ProgressForm.UpdateProgressBar(text, amount, continuous);
     }
 }
        public static void CloseProgressBar()
        {
            if (ProgressForm == null)
            {
                return;
            }

            if (ProgressForm.InvokeRequired)
            {
                ProgressForm.Invoke((MethodInvoker) delegate {
                    ProgressForm.Close();
                    ProgressForm = null;
                });
            }
            else
            {
                ProgressForm.Close();
                ProgressForm = null;
            }
        }