Ejemplo n.º 1
0
 public Updater_Progress(Updater updater, Log log)
 {
     InitializeComponent();
     this.updater = updater;
     this.log = log;
     Util.LoadTheme(metroStyleManager1);
 }
Ejemplo n.º 2
0
 public Updater_Progress(Updater updater, Log log)
 {
     InitializeComponent();
     this.updater = updater;
     this.log = log;
     Util.LoadTheme(this, this.Controls);
 }
Ejemplo n.º 3
0
        private void updatechecker_DoWork(object sender, DoWorkEventArgs e)
        {
            string response = SteamTrade.SteamWeb.Fetch(Util.UpdateCheckUrl);
            if (response != "")
            {
                string latestVer = Util.ParseBetween(response, "<version>", "</version>");
                if (Properties.Settings.Default.SkipUpdate && Properties.Settings.Default.SkippedVersion != latestVer.Trim())
                {
                    Properties.Settings.Default.SkipUpdate = false;
                    Properties.Settings.Default.Save();
                    string[] changelog = Util.GetStringInBetween("<changelog>", "</changelog>", response, false, false);
                    if (!string.IsNullOrEmpty(changelog[0]))
                    {
                        Updater updater = new Updater(latestVer, changelog[0], log);
                        updater.ShowDialog();
                        updater.Activate();
                    }
                }
                else if (!Properties.Settings.Default.SkipUpdate && latestVer.Trim() != Friends.MistVersion)
                {
                    string[] changelog = Util.GetStringInBetween("<changelog>", "</changelog>", response, false, false);
                    if (!string.IsNullOrEmpty(changelog[0]))
                    {
                        Updater updater = new Updater(latestVer, changelog[0], log);
                        updater.ShowDialog();
                        updater.Activate();
                    }
                }
                else
                {

                }
            }
        }
Ejemplo n.º 4
0
 private void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     string response = SteamTrade.SteamWeb.Fetch(Util.UpdateCheckUrl);
     if (response != "")
     {
         string latestVer = Util.ParseBetween(response, "<version>", "</version>");
         if (latestVer != Friends.MistVersion)
         {
             string[] changelog = Util.GetStringInBetween("<changelog>", "</changelog>", response, false, false);
             if (!string.IsNullOrEmpty(changelog[0]))
             {
                 Updater updater = new Updater(latestVer, changelog[0], bot.log);
                 updater.ShowDialog();
                 updater.Activate();
             }
         }
         else
         {
             MetroFramework.MetroMessageBox.Show(this, "Congratulations, Mist is up-to-date! Thank you for using Mist :)",
                 "Latest Version",
                 MessageBoxButtons.OK,
                 MessageBoxIcon.Information,
                 MessageBoxDefaultButton.Button1);
         }
     }
     else
     {
         MetroFramework.MetroMessageBox.Show(this, "Failed to connect to the update server! Please try again later.",
                 "Update Error",
                 MessageBoxButtons.OK,
                 MessageBoxIcon.Error,
                 MessageBoxDefaultButton.Button1);
     }
 }
Ejemplo n.º 5
0
        private void updatechecker_DoWork(object sender, DoWorkEventArgs e)
        {
            string url = "http://www.thectscommunity.com/dev/update_check.php";
            string response = Util.HTTPRequest(url);
            if (response != "")
            {
                string latestVer = Util.ParseBetween(response, "<version>", "</version>");
                if (Properties.Settings.Default.SkipUpdate && Properties.Settings.Default.SkippedVersion != latestVer.Trim())
                {
                    Properties.Settings.Default.SkipUpdate = false;
                    Properties.Settings.Default.Save();
                    string[] changelog = Util.GetStringInBetween("<changelog>", "</changelog>", response, false, false);
                    if (!string.IsNullOrEmpty(changelog[0]))
                    {
                        Updater updater = new Updater(latestVer, changelog[0], log);
                        updater.ShowDialog();
                        updater.Activate();
                    }
                }
                else if (!Properties.Settings.Default.SkipUpdate && latestVer.Trim() != Friends.mist_ver)
                {
                    string[] changelog = Util.GetStringInBetween("<changelog>", "</changelog>", response, false, false);
                    if (!string.IsNullOrEmpty(changelog[0]))
                    {
                        Updater updater = new Updater(latestVer, changelog[0], log);
                        updater.ShowDialog();
                        updater.Activate();
                    }
                }
                else
                {

                }
            }
        }
Ejemplo n.º 6
0
 private void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     string url = "http://www.thectscommunity.com/dev/update_check.php";
     string response = Util.HTTPRequest(url);
     if (response != "")
     {
         string latestVer = Util.ParseBetween(response, "<version>", "</version>");
         if (latestVer != Friends.mist_ver)
         {
             string[] changelog = Util.GetStringInBetween("<changelog>", "</changelog>", response, false, false);
             if (!string.IsNullOrEmpty(changelog[0]))
             {
                 Updater updater = new Updater(latestVer, changelog[0], bot.log);
                 updater.ShowDialog();
                 updater.Activate();
             }
         }
         else
         {
             MessageBox.Show("Congratulations, Mist is up-to-date! Thank you for using Mist :)",
                 "Latest Version",
                 MessageBoxButtons.OK,
                 MessageBoxIcon.Information,
                 MessageBoxDefaultButton.Button1);
         }
     }
     else
     {
         MessageBox.Show("Failed to connect to the update server! Please try again later.",
                 "Update Error",
                 MessageBoxButtons.OK,
                 MessageBoxIcon.Error,
                 MessageBoxDefaultButton.Button1);
     }
 }