Ejemplo n.º 1
0
        private void startup(object state)
        {
            updateCheck();
            var json = getVersions();

            if (json == null)
            {
                MessageBox.Show("Fatal: Cannot get versions list!");
                Application.Exit();
            }
            else
            {
                VersionList versionlist = Newtonsoft.Json.JsonConvert.DeserializeObject <VersionList>(json);

                foreach (Version ver in versionlist.versions)   //download and parse the configs
                //TODO: do this as needed with a cache.
                {
                    try {
                        ver.configVR = getCfg(ver.vrcfg);
                    } catch (Exception) {
                    }

                    try {
                        ver.configNONVR = getCfg(ver.nonvrcfg);
                    } catch (Exception) {
                    }
                }


                this.BeginInvoke((MethodInvoker) delegate {
                    this.Cursor = Cursors.Default;
                    populateVersions(versionlist);
                });
            }
        }
Ejemplo n.º 2
0
 private void populateVersions(VersionList list)
 {
     this.versionlist = list;
     cmbVersion.Items.Clear();
     cmbVersion.Items.AddRange(list.versions);
     if (cmbVersion.Items.Count > 0)
     {
         cmbVersion.SelectedIndex = 0;
     }
 }