Ejemplo n.º 1
0
 public override void Upgrade(SirenOfShameSettings sirenOfShameSettings)
 {
     if (sirenOfShameSettings.GetAllActiveBuildDefinitions().Any())
     {
         sirenOfShameSettings.TryToFindOldAchievementsAtNextOpportunity = true;
     }
 }
Ejemplo n.º 2
0
 public override void Upgrade(SirenOfShameSettings sirenOfShameSettings)
 {
     if (sirenOfShameSettings.GetAllActiveBuildDefinitions().Any())
     {
         sirenOfShameSettings.TryToFindOldAchievementsAtNextOpportunity = true;
     }
 }
Ejemplo n.º 3
0
 public override void Upgrade(SirenOfShameSettings sirenOfShameSettings)
 {
     if (sirenOfShameSettings.GetAllActiveBuildDefinitions().Any())
     {
         sirenOfShameSettings.ShowUpgradeWindowAtNextOpportunity = true;
     }
 }
Ejemplo n.º 4
0
 public override void Upgrade(SirenOfShameSettings sirenOfShameSettings)
 {
     if (sirenOfShameSettings.GetAllActiveBuildDefinitions().Any())
     {
         sirenOfShameSettings.ShowUpgradeWindowAtNextOpportunity = true;
     }
 }
Ejemplo n.º 5
0
 public override void Upgrade(SirenOfShameSettings settings)
 {
     var isUpgradingFromPreviousVersion = settings.GetAllActiveBuildDefinitions().Any();
     bool isntAlreadyUsingMyCi = settings.SosOnlineWhatToSync != WhatToSyncEnum.BuildStatuses;
     if (isUpgradingFromPreviousVersion && isntAlreadyUsingMyCi)
     {
         settings.ShowUpgradeWindowAtNextOpportunity = true;
     }
 }
Ejemplo n.º 6
0
        public override void Upgrade(SirenOfShameSettings settings)
        {
            var  isUpgradingFromPreviousVersion = settings.GetAllActiveBuildDefinitions().Any();
            bool isntAlreadyUsingMyCi           = settings.SosOnlineWhatToSync != WhatToSyncEnum.BuildStatuses;

            if (isUpgradingFromPreviousVersion && isntAlreadyUsingMyCi)
            {
                settings.ShowUpgradeWindowAtNextOpportunity = true;
            }
        }
Ejemplo n.º 7
0
        public override void Upgrade(SirenOfShameSettings settings)
        {
            SosDb sosDb = new SosDb();
            List<BuildStatus> allActiveBuildDefinitionsOrderedChronoligically = sosDb
                .ReadAll(settings.GetAllActiveBuildDefinitions())
                .OrderBy(i => i.StartedTime)
                .ToList();

            settings.People.ForEach(i => i.CalculateStats(allActiveBuildDefinitionsOrderedChronoligically));
        }
Ejemplo n.º 8
0
        private void RecalculateAchievements()
        {
            var sosDb       = new SosDb();
            var allSettings = sosDb
                              .ReadAll(_settings.GetAllActiveBuildDefinitions())
                              .OrderBy(i => i.StartedTime)
                              .ToList();

            foreach (var person in _settings.People)
            {
                person.TotalBuilds  = 0;
                person.FailedBuilds = 0;
                person.Achievements.Clear();
                person.CumulativeBuildTime = 0;
            }
            _status.Visible = true;
            var allActiveBuildDefinitionsOrderedChronoligically = new List <BuildStatus>();
            var buildCount = allSettings.Count;

            progressBar1.Maximum = buildCount;
            foreach (var buildStatus in allSettings)
            {
                _status.Text = string.Format("Processing {0:d}", buildStatus.StartedTime);
                progressBar1.Value++;
                var person = _settings.People.FirstOrDefault(i => i.RawName == buildStatus.RequestedBy);
                if (person == null)
                {
                    _log.Error("Could not find " + buildStatus.RequestedBy);
                    continue;
                }
                person.TotalBuilds++;
                if (buildStatus.BuildStatusEnum == BuildStatusEnum.Broken)
                {
                    person.FailedBuilds++;
                }
                allActiveBuildDefinitionsOrderedChronoligically.Add(buildStatus);
                var newAchievements = person
                                      .CalculateNewAchievements(_settings, buildStatus, allActiveBuildDefinitionsOrderedChronoligically)
                                      .ToList();

                if (!newAchievements.Any())
                {
                    continue;
                }

                person.AddAchievements(newAchievements);
                foreach (var achievementLookup in newAchievements)
                {
                    NewAchievement.ShowForm(_settings, achievementLookup, person, this, modal: true);
                }
            }
            _settings.Save();
        }
Ejemplo n.º 9
0
        public string ExportNewBuilds(SirenOfShameSettings settings)
        {
            if (string.IsNullOrEmpty(settings.MyRawName))
            {
                return(null);
            }
            DateTime?highWaterMark       = settings.GetHighWaterMark();
            var      initialExport       = highWaterMark == null;
            var      allBuildDefinitions = ReadAll(settings.GetAllActiveBuildDefinitions());
            var      currentUsersBuilds  = allBuildDefinitions
                                           .Where(i => i.RequestedBy == settings.MyRawName)
                                           .Where(i => i.StartedTime != null);
            var buildsAfterHighWaterMark = initialExport ? currentUsersBuilds : currentUsersBuilds.Where(i => i.StartedTime > highWaterMark);
            var buildsAsExport           = buildsAfterHighWaterMark.Select(i => i.AsSosOnlineExport());
            var result = string.Join("\r\n", buildsAsExport);

            return(string.IsNullOrEmpty(result) ? null : result);
        }
Ejemplo n.º 10
0
        public override void Upgrade(SirenOfShameSettings settings)
        {
            SosDb sosDb = new SosDb();
            List <BuildStatus> allActiveBuildDefinitionsOrderedChronoligically = sosDb
                                                                                 .ReadAll(settings.GetAllActiveBuildDefinitions())
                                                                                 .OrderBy(i => i.StartedTime)
                                                                                 .ToList();

            settings.People.ForEach(i => i.CalculateStats(allActiveBuildDefinitionsOrderedChronoligically));
        }