private void CheckForUpdates()
        {
            Version version = GetLatestOnlineVersion();

            if (version != null)
            {
                Version currentVersion = Assembly.GetExecutingAssembly().GetName().Version;
                if (version > currentVersion)
                {
                    _showingDialog = true;

                    string changes = ReadChangeListFile();

                    _mainForm.Invoke(new MethodInvoker(delegate()
                    {
                        NewVersionAlert nva = new NewVersionAlert(currentVersion, version, changes);
                        nva.ShowDialog(_mainForm);
                    }));

                    _showingDialog = false;

                    // stop if needed
                    AutoUpdateManager.Run(_mainForm);
                }
            }
        }
 public static void Run(Form form)
 {
     if (TaskbarPropertiesManager.Instance.Properties.CheckForUpdates)
     {
         if (Instance == null)
         {
             Instance = new AutoUpdateManager(form);
         }
     }
     else
     {
         if (Instance != null)
         {
             Instance.Dispose();
             Instance = null;
         }
     }
 }