예제 #1
0
        private void listVersions_SelectedIndexChanged(object sender, EventArgs e)
        {
            AppVersion version = listVersions.SelectedItem as AppVersion;

            if (version != null)
            {
                bool isLatest = VersionList.Latest != null && version.GetVersion() == VersionList.Latest.GetVersion();

                textDescription.Clear();
                textDescription.AppendText("Version: ");
                textDescription.AppendText(version.ToString() + "\n\n");
                textDescription.AppendText("Has been released: " + (version.Released ? "Yes" : "No") + "\n");
                if (isLatest)
                {
                    textDescription.AppendText("This version is the recommended for download!\n");
                }
                if (version.Description != null)
                {
                    textDescription.AppendText(version.Description);
                }

                toolStripStatusLabel.Text = "Selected Version: " + version.ToString()
                                            + (isLatest ? " * Latest *" : "")
                                            + " [" + version.URL + "]";
            }
        }
        private static bool UpdateAvailable(AppVersionList list)
        {
            AppVersion currentVersion = GetCurrentVersion();

            if (list != null && list.Latest != null)
            {
                if (currentVersion.GetVersion() < list.Latest.GetVersion())
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }