Ejemplo n.º 1
0
    void RefreshCompleted(object sender, DownloadStringCompletedEventArgs e)
    {
        if (!e.Cancelled && e.Error == null)
        {
            _update = JsonConvert.DeserializeObject <JSONUpdate>(e.Result);

            if (_update.VersionCode > VersionCode || _update.Force)
            {
                richTextBox1.Text += dot + "A new update is available (version " + _update.Version + "). Changelog:\n";

                if (!_update.Manual)
                {
                    richTextBox1.Text      += _update.Changelog + "\n\n" + dot + "Press \"Download update\" to begin.\n";
                    button_download.Enabled = true;
                }
                else
                {
                    richTextBox1.Text += _update.Changelog + "\n\n" + dot + "Automatic update not possible. Please visit the Icy Monitor website to download the update.\n";
                }
            }
            else
            {
                richTextBox1.Text += dot + "No new updates available.\n";
            }
        }
        else
        {
            richTextBox1.Text += dot + "Could not contact update server.\n";
        }
    }
Ejemplo n.º 2
0
    void RefreshCompleted(object sender, DownloadStringCompletedEventArgs e)
    {
        if (!e.Cancelled && e.Error == null) {
            _update = JsonConvert.DeserializeObject<JSONUpdate>(e.Result);

            if (_update.VersionCode > VersionCode || _update.Force) {
                richTextBox1.Text += dot + "A new update is available (version " + _update.Version + "). Changelog:\n";

                if (!_update.Manual) {
                    richTextBox1.Text += _update.Changelog + "\n\n" + dot + "Press \"Download update\" to begin.\n";
                    button_download.Enabled = true;
                } else {
                    richTextBox1.Text += _update.Changelog + "\n\n" + dot + "Automatic update not possible. Please visit the Icy Monitor website to download the update.\n";
                }
            } else {
                richTextBox1.Text += dot + "No new updates available.\n";
            }
        } else {
            richTextBox1.Text += dot + "Could not contact update server.\n";
        }
    }