Exemplo n.º 1
0
        private void btnCheckUpdate_Click(object sender, EventArgs e)
        {
            GithubUpdater update = new GithubUpdater("leandrosa81", "taskbar-monitor");

            if (btnCheckUpdate.Text == "Check for updates")
            {
                btnCheckUpdate.Enabled = false;
                btnCheckUpdate.Text    = "checking...";


                var task = update.GetLastestVersionAsync();

                var latestVersion = task.Result;

                if (latestVersion != null)
                {
                    if (latestVersion.CompareTo(this.Version) > 0)
                    {
                        btnCheckUpdate.Text       = "there is an update!";
                        lblLatestVersion.Visible  = false;
                        linkLatestVersion.Text    = "v" + latestVersion.ToString();
                        linkLatestVersion.Top     = lblLatestVersion.Top;
                        linkLatestVersion.Left    = lblLatestVersion.Left;
                        linkLatestVersion.Visible = true;
                    }
                    else
                    {
                        btnCheckUpdate.Text   = "no updates";
                        lblLatestVersion.Text = "v" + latestVersion.ToString();
                    }
                }

                btnCheckUpdate.Enabled = true;
            }
        }
Exemplo n.º 2
0
        private void linkLatestVersion_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            GithubUpdater update = new GithubUpdater("leandrosa81", "taskbar-monitor");

            System.Diagnostics.Process.Start(update.GetURL());
        }