private void BuildWatcherStatusChecked(object sender, StatusCheckedEventArgsArgs args) { ApplyUserMappings(args); SendCiServerConnectedEvents(); TryToGetAndSendNewSosOnlineAlerts(); BuildStatus[] allBuildStatuses = BuildStatusUtil.Merge(_previousBuildStatuses, args.BuildStatuses); IList <BuildStatus> changedBuildStatuses = GetChangedBuildStatuses(allBuildStatuses); if (!changedBuildStatuses.Any()) { return; } InvokeSetTrayIcon(changedBuildStatuses); InvokeRefreshStatusIfAnythingChanged(allBuildStatuses, changedBuildStatuses); AddAnyNewPeopleToSettings(changedBuildStatuses); UpdateBuildNamesInSettingsIfAnyChanged(changedBuildStatuses); IList <ChangedBuildStatusesAndTheirPreviousState> changedBuildStatusesAndTheirPreviousState = GetChangedBuildStatusesAndTheirPreviousState(changedBuildStatuses); FireApplicableRulesEngineEvents(changedBuildStatusesAndTheirPreviousState); WriteNewBuildsToSosDb(changedBuildStatusesAndTheirPreviousState); NotifyIfNewAchievements(changedBuildStatuses); InvokeStatsChanged(changedBuildStatuses); SyncNewBuildsToSos(changedBuildStatuses); InvokeNewNewsItemIfAny(changedBuildStatusesAndTheirPreviousState); CacheBuildStatuses(changedBuildStatuses); }
private void ApplyUserMappings(StatusCheckedEventArgsArgs args) { foreach (var buildStatus in args.BuildStatuses) { string requestedBy = buildStatus.RequestedBy; var userMapping = _settings.UserMappings.FirstOrDefault(i => i.WhenISee == requestedBy); bool userMappingExistsForThisUser = userMapping != null; if (userMappingExistsForThisUser) { buildStatus.RequestedBy = userMapping.PretendItsActually; } } }
private void ApplyUserMappings(StatusCheckedEventArgsArgs args) { foreach (var buildStatus in args.BuildStatuses) { if (buildStatus == null) { _log.Warn("There was a BuildStatus that was null, this should never happen."); continue; } string requestedBy = buildStatus.RequestedBy; var userMapping = _settings.UserMappings.FirstOrDefault(i => i.WhenISee == requestedBy); bool userMappingExistsForThisUser = userMapping != null; if (userMappingExistsForThisUser) { buildStatus.RequestedBy = userMapping.PretendItsActually; } } }
private void BuildWatcherStatusChecked(object sender, StatusCheckedEventArgsArgs args) { ApplyUserMappings(args); SendCiServerConnectedEvents(); TryToGetAndSendNewSosOnlineAlerts(); BuildStatus[] allBuildStatuses = BuildStatusUtil.Merge(_previousBuildStatuses, args.BuildStatuses); IList<BuildStatus> changedBuildStatuses = GetChangedBuildStatuses(allBuildStatuses); if (!changedBuildStatuses.Any()) return; InvokeSetTrayIcon(changedBuildStatuses); InvokeRefreshStatusIfAnythingChanged(allBuildStatuses, changedBuildStatuses); AddAnyNewPeopleToSettings(changedBuildStatuses); UpdateBuildNamesInSettingsIfAnyChanged(changedBuildStatuses); IList<ChangedBuildStatusesAndTheirPreviousState> changedBuildStatusesAndTheirPreviousState = GetChangedBuildStatusesAndTheirPreviousState(changedBuildStatuses); FireApplicableRulesEngineEvents(changedBuildStatusesAndTheirPreviousState); WriteNewBuildsToSosDb(changedBuildStatusesAndTheirPreviousState); NotifyIfNewAchievements(changedBuildStatuses); InvokeStatsChanged(changedBuildStatuses); SyncNewBuildsToSos(changedBuildStatuses); InvokeNewNewsItemIfAny(changedBuildStatusesAndTheirPreviousState); CacheBuildStatuses(changedBuildStatuses); }
private void BuildWatcherStatusChecked(object sender, StatusCheckedEventArgsArgs args) { ExecuteNewBuilds(args.BuildStatuses); }