示例#1
0
        void updController_updateFound(object sender, updateFoundEventArgs e)
        {
            var version = e.Result.newUpdatePackages.Last().releaseInfo.Version;
            NewVersion = version.Substring(0, version.Length - 2); //remove two to get 0.0.0 instead of 0.0.0.0
            var sb = new StringBuilder();
            foreach (var package in e.Result.newUpdatePackages)
            {
                DateTime releaseDateTime;
                var releaseDateTimeString = DateTime.TryParse(package.ReleaseDate, out releaseDateTime) ? releaseDateTime.ToString(Application.Current.Resources["DateFormat"].ToString()) : package.ReleaseDate;

                sb.AppendLine("[i]" + string.Format(Application.Current.Resources["UpdateChangelogText"].ToString(), package.releaseInfo.Version, releaseDateTimeString));
                sb.AppendLine();
                sb.AppendLine(_language == Language.English ? _updController.currentUpdateResult.Changelogs[package].englishChanges : _updController.currentUpdateResult.Changelogs[package].germanChanges);
                sb.AppendLine();
                UpdateSize += package.packageSize;
            }
            Changelog = sb.ToString();
            UpdateFound = true;
        }
示例#2
0
 private void updateController1_updateFound(object sender, updateFoundEventArgs e)
 {
     if (updateController1.showUpdateDialog() == DialogResult.OK)
     {
         updateController1.downloadUpdatesDialog();
         updateController1.applyUpdate();
     }
 }