Пример #1
0
        protected UpdateInfo(ReleaseEntry currentlyInstalledVersion, IEnumerable <ReleaseEntry> releasesToApply, string packageDirectory, FrameworkVersion appFrameworkVersion)
        {
            // NB: When bootstrapping, CurrentlyInstalledVersion is null!
            CurrentlyInstalledVersion = currentlyInstalledVersion;
            ReleasesToApply           = releasesToApply ?? Enumerable.Empty <ReleaseEntry>();
            FutureReleaseEntry        = ReleasesToApply.MaxBy(x => x.Version).FirstOrDefault();
            AppFrameworkVersion       = appFrameworkVersion;

            this.packageDirectory = packageDirectory;
        }
        protected UpdateInfo(ReleaseEntry currentlyInstalledVersion, IEnumerable <ReleaseEntry> releasesToApply, string packageDirectory)
        {
            // NB: When bootstrapping, CurrentlyInstalledVersion is null!
            CurrentlyInstalledVersion = currentlyInstalledVersion;
            ReleasesToApply           = (releasesToApply ?? Enumerable.Empty <ReleaseEntry>()).ToList();
            FutureReleaseEntry        = ReleasesToApply.Any() ?
                                        ReleasesToApply.MaxBy(x => x.Version).FirstOrDefault() :
                                        CurrentlyInstalledVersion;

            this.PackageDirectory = packageDirectory;
        }
 public Dictionary <ReleaseEntry, string> FetchReleaseNotes()
 {
     return(ReleasesToApply
            .SelectMany(x => {
         try {
             var releaseNotes = x.GetReleaseNotes(PackageDirectory);
             return EnumerableExtensions.Return(Tuple.Create(x, releaseNotes));
         } catch (Exception ex) {
             this.Log().WarnException("Couldn't get release notes for:" + x.Filename, ex);
             return Enumerable.Empty <Tuple <ReleaseEntry, string> >();
         }
     })
            .ToDictionary(k => k.Item1, v => v.Item2));
 }
 public Dictionary <ReleaseEntry, string> FetchReleaseNotes()
 {
     return(ReleasesToApply
            .Select(x => new { Entry = x, Readme = x.GetReleaseNotes(PackageDirectory) })
            .ToDictionary(k => k.Entry, v => v.Readme));
 }