Esempio n. 1
0
        private void btnVersionDownloader_Click(object sender, EventArgs e)
        {
            sideversionForm.lbVersions.SelectedIndex = -1;

            lastSelectedVersion = null;

            clearAnchorRight();

            MainForm.vdppForm          = new VersionDownloadPanel();
            MainForm.vdppForm.TopLevel = false;
            pnAnchorRight.Controls.Add(MainForm.vdppForm);
            MainForm.vdppForm.Dock = DockStyle.Fill;
            MainForm.vdppForm.Show();
        }
Esempio n. 2
0
        public void RefreshInstalledVersions()
        {
            lbVersions.Items.Clear();
            List <string> versions = new List <string>(Directory.GetDirectories(launcherDir + Path.DirectorySeparatorChar + "VERSIONS" + Path.DirectorySeparatorChar));

            lbVersions.Items.AddRange(versions.OrderByNaturalDescending(x => x).Select(it => getFilenameFromFullFilename(it)).ToArray <object>());
            this.PerformLayout();
            SelectedVersion = null;


            Action a = () =>
            {
                string latestVersion = VersionDownloadPanel.getLatestVersion();
                this.Invoke(new MethodInvoker(() => { pbNewVersionNotification.Visible = !versions.Select(it => it.Substring(it.LastIndexOf('\\') + 1)).Contains(latestVersion); }));
            };

            Task.Run(a);
        }