Exemplo n.º 1
0
 /// <summary>
 /// It get's called when an update is downloaded
 /// </summary>
 /// <param name="update">Update message that got downloaded</param>
 public static void UpdateFound(UpdateCheck.UpdateMessage update)
 {
     if (update.version.Length > 2 &&
         update.version != Application.ProductVersion)
     {
         mainForm.BeginInvoke((MethodInvoker)delegate
         {
             ShowCheckUpdateForm();
             checkUpdateForm.updateLink.Text = update.link;
             checkUpdateForm.newVersion.Text = update.version;
             checkUpdateForm.curVersion.Text = Application.ProductVersion;
             checkUpdateForm.updateMessage.Text = update.message;
         });
     }
     else
     {
         Logger.Add("Update Checked : This is the latest version.", "Interactivity|UpdateFound()");
     }
 }
Exemplo n.º 2
0
 private void checkUpdateButton_Click(object sender, EventArgs e)
 {
     UpdateCheck.CheckForUpdate();
 }
Exemplo n.º 3
0
 private void checkForUpdateToolStripMenuItem_Click(object sender, EventArgs e)
 {
     UpdateCheck.CheckForUpdate();
 }
Exemplo n.º 4
0
        private void DelayInitialize(object background)
        {
            //run in background
            if ((bool)background)
            {
                this.Cursor = Cursors.AppStarting;
                System.Threading.ThreadPool.QueueUserWorkItem(DelayInitialize, false);
                return;
            }

            //load problem database
            LocalDatabase.RunLoadAsync(false);

            //load controls
            bool _initialized = false;

            this.BeginInvoke((MethodInvoker) delegate
            {
                //add controls
                AddControls();

                //add buttons to the top right beside control buttons
                //AddActiveButtons();

                _initialized = true;
                this.Cursor  = Cursors.Default;
                Logger.Add("Initialized all controls", "Main Form");

                loadingPanel.Visible = false;
            });

            //update problem database if not available
            if (LocalDirectory.GetFileSize(LocalDirectory.GetProblemInfoFile()) < 100)
            {
                while (!_initialized)
                {
                    System.Threading.Thread.Sleep(1000);
                }
                System.Threading.Thread.Sleep(2000);
                this.BeginInvoke((MethodInvoker) delegate
                {
                    UVA_Arena.Internet.Downloader.DownloadProblemDatabase();
                });
            }

            //update user submissions if not available
            if (LocalDatabase.ContainsUser(RegistryAccess.DefaultUsername))
            {
                string file = LocalDirectory.GetUserSubPath(RegistryAccess.DefaultUsername);
                if (LocalDirectory.GetFileSize(file) < 50)
                {
                    System.Threading.Thread.Sleep(1000);
                    this.BeginInvoke((MethodInvoker) delegate
                    {
                        Interactivity.userstat.DownloadUserSubs(RegistryAccess.DefaultUsername);
                    });
                }
            }

            //check for updates
            System.Threading.Thread.Sleep(10000);
            UpdateCheck.CheckForUpdate();
        }