コード例 #1
0
ファイル: Form1.cs プロジェクト: inventor02/SBR
        private async void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bool res = await UpdateBackend.checkForUpdates(this);

            if (!res)
            {
                MessageBox.Show(null, "You're already on the latest update!", "No update available", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
コード例 #2
0
        public static bool checkForUpdates(Form1 m)
        {
            object[] response = UpdateBackend.updateAvail(0);
            bool     av       = (bool)response[0];
            string   latest   = (string)response[1];
            string   current  = (string)response[2];

            if (av)
            {
                DialogResult res = MessageBox.Show(null, "An update is available!\nInstalled version: " + current + "\nLatest version: " + latest + "\n\nWould you like to install this update now?", "Update available (" + ((string)response[3]) + " server)", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                if (res == DialogResult.Yes)
                {
                    update(0);
                }
            }
            return(av);
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: inventor02/SBR
        private void Form1_Load(object sender, EventArgs e)
        {
            PrepareButtons(Settings.LoadStringArray());
            buttonReset.Focus();
            int    color = Settings.settings.global_background;
            String back  = Settings.colors[color];

            this.BackColor = ColorTranslator.FromHtml(back);
            int    color2 = Settings.settings.global_foreground;
            String fore   = Settings.colors[color2];

            this.ForeColor = ColorTranslator.FromHtml(fore);
            Control[] arr = new Control[this.Controls.Count];
            this.Controls.CopyTo(arr, 0);
            paintControls(arr, fore, back);
            if (Settings.settings.cfuos)
            {
                UpdateBackend.checkForUpdates(this);
            }
        }