public void RefreshDisplayNames(SirenOfShameSettings settings) { foreach (var buildStatusDto in BuildStatusDtos) { buildStatusDto.SetDisplayName(settings); } }
public ConfigureSounds(SirenOfShameSettings settings) { _settings = settings; InitializeComponent(); RefreshSoundList(); }
public void GetMostRecentNewsItems(SirenOfShameSettings settings, Action<IList<NewNewsItemEventArgs>> onGetNewsItems) { var location = GetEventsLocation(); if (!FileAdapter.Exists(location)) onGetNewsItems(new List<NewNewsItemEventArgs>()); var context = TaskScheduler.FromCurrentSynchronizationContext(); var newsItemGetter = new Task<List<NewNewsItemEventArgs>>(() => FileAdapter.ReadAllLines(location) .Select(i => NewNewsItemEventArgs.FromCommaSeparated(i, settings)) .Where(i => i != null) .Reverse() .ToList()); newsItemGetter.ContinueWith(result => onGetNewsItems(result.Result), new CancellationToken(), TaskContinuationOptions.OnlyOnRanToCompletion, context); newsItemGetter.ContinueWith(t => { if (t.Exception != null) { var exception = t.Exception.InnerExceptions.First(); if (!(exception is FileNotFoundException)) _log.Error(exception); } onGetNewsItems(new List<NewNewsItemEventArgs>()); }, new CancellationToken(), TaskContinuationOptions.OnlyOnFaulted, context); newsItemGetter.Start(); }
public ConfigureSosOnline(SirenOfShameSettings settings) { _settings = settings; InitializeComponent(); _alwaysOffline.Checked = _settings.SosOnlineAlwaysOffline; LoadChildControl(); }
public AddRule(SirenOfShameSettings settings) { IocContainer.Instance.Compose(this); _settings = settings; InitializeComponent(); EnableAudioSettings(enable: false); EnableLightSettings(enable: false); _when.DataSource = Rule.TriggerTypes.Select(i => new KeyValuePair<TriggerType, string>(i.Key, i.Value )).ToList(); _when.DisplayMember = "Value"; var buildDefinitions = _settings.CiEntryPointSettings .SelectMany(i => i.BuildDefinitionSettings) .Where(bd => bd.Active) .ToList(); buildDefinitions.Insert(0, _anyBuild); _build.DataSource = buildDefinitions; _build.DisplayMember = "Name"; _audio.DataSource = SirenOfShameDevice.AudioPatterns.ToList(); _audio.DisplayMember = "Name"; _windowsAudio.DataSource = new[] { new AudioFile { DisplayName = "None"}} .Concat(ResourceManager.InternalAudioFiles) .ToList(); _windowsAudio.DisplayMember = "DisplayName"; _lights.DataSource = SirenOfShameDevice.LedPatterns.ToList(); _lights.DisplayMember = "Name"; _who.DataSource = _settings.AllUsersMinusMappedOnes(); }
public RulesEngine(SirenOfShameSettings settings) { ResetPreviousWorkingOrBrokenStatuses(); _settings = settings; _timer.Interval = 1000; _timer.Tick += TimerTick; }
public ConfigureServer(SirenOfShameSettings settings, CiEntryPointSetting ciEntryPointSetting) { _adding = ciEntryPointSetting == null; if (_adding) { ciEntryPointSetting = new CiEntryPointSetting(); } Settings = settings; _ciEntryPointSetting = ciEntryPointSetting; IocContainer.Instance.Compose(this); InitializeComponent(); _ciServerPanel.Visible = _adding; ICiEntryPoint[] ciEntryPoints = CIEntryPoints.ToArray(); if (_adding) { _serverType.DataSource = ciEntryPoints; } else { SetServerType(ciEntryPointSetting.GetCiEntryPoint(settings)); } _add.Text = _adding ? "Add" : "Update"; _cancel.Visible = _adding; }
public ConfigureMock(SirenOfShameSettings settings, MockCiEntryPoint mockCiEntryPoint, CiEntryPointSetting ciEntryPointSetting) : base(settings) { InitializeComponent(); _mockCiEntryPoint = mockCiEntryPoint; _ciEntryPointSetting = ciEntryPointSetting; }
public ConfigureServers(SirenOfShameSettings settings) { _settings = settings; InitializeComponent(); _servers.DataSource = settings.CiEntryPointSettings; _servers.DisplayMember = "Url"; }
public ConfigureServerBase(SirenOfShameSettings settings) { // http://www.codeproject.com/Tips/61966/Control-Resizing-on-a-UserControl-in-WinForms.aspx?msg=3389586 Dock = DockStyle.Fill; Settings = settings; }
public ConfigureTravisCi(SirenOfShameSettings sosSettings, TravisCiEntryPoint travisCiEntryPoint, CiEntryPointSetting ciEntryPointSetting) : base(sosSettings) { _travisCiEntryPoint = travisCiEntryPoint; _ciEntryPointSetting = ciEntryPointSetting; InitializeComponent(); LoadProjectList(); }
public void Write(BuildStatus buildStatus, SirenOfShameSettings settings, bool disableWritingToSosDb) { if (!disableWritingToSosDb) { AppendToFile(buildStatus); } UpdateStatsInSettings(buildStatus, settings); }
public ViewBuildSmall(BuildStatusDto buildStatusDto, SirenOfShameSettings settings) : base(settings) { InitializeComponent(); InitializeLabels(buildStatusDto); FontChanged += OnFontChanged; StoreInitialFontSizes(); }
public RulesEngine(SirenOfShameSettings settings) { DisableSosOnline = false; DisableWritingToSosDb = false; ResetPreviousWorkingOrBrokenStatuses(); _settings = settings; _timer.Interval = 1000; _timer.Tick += TimerTick; }
public IEnumerable<AchievementLookup> CalculateNewAchievements(SirenOfShameSettings settings, BuildStatus build) { List<BuildStatus> allActiveBuildDefinitionsOrderedChronoligically = _sosDb .ReadAll(settings.GetAllActiveBuildDefinitions()) .OrderBy(i => i.StartedTime) .ToList(); return CalculateNewAchievements(settings, build, allActiveBuildDefinitionsOrderedChronoligically); }
public AddMapping(SirenOfShameSettings settings, string whenISeeDefaultRawName = null) { _settings = settings; InitializeComponent(); AddPeopleToDropdowns(); RemovePeopleThatHaveAlreadyBeenMappedFromDropdowns(); SetWhenISeeDropdownToDefault(whenISeeDefaultRawName); }
public void Initialize(SirenOfShameSettings settings, ImageList avatarImageList) { _settings = settings; var peopleByReputation = settings.People.OrderByDescending(i => i.GetReputation()); foreach (var person in peopleByReputation) { AddUserPanel(avatarImageList, person); } }
public void SirenNeverBeenConnected() { PersonSetting personSetting = new PersonSetting { RawName = "currentUser" }; SirenOfShameSettings settings = new SirenOfShameSettings(false) { SirenEverConnected = false, MyRawName = "currentUser" }; Assert.AreEqual(false, new ShamePusher(personSetting, settings).HasJustAchieved()); }
public void SirenHasBeenConnectedButDifferentUserCheckedIn() { PersonSetting personSetting = new PersonSetting {RawName = "someoneElse"}; SirenOfShameSettings settings = new SirenOfShameSettings(false) { SirenEverConnected = true, MyRawName = "currentUser" }; Assert.AreEqual(false, new ShamePusher(personSetting, settings).HasJustAchieved()); }
public SyncOnline(SirenOfShameSettings settings) { _settings = settings; InitializeComponent(); InitializeSosOnlineSection(); InitializeProxySection(); InitializeRadioButtons(); _settings.InitializeUserIAm(_userIAm); _initializing = false; }
public ConfigureAppVeyor(SirenOfShameSettings sosSettings, AppVeyorCiEntryPoint appVeyorCiEntryPoint, CiEntryPointSetting ciEntryPointSetting) : base(sosSettings) { _appVeyorCiEntryPoint = appVeyorCiEntryPoint; InitializeComponent(); _ciEntryPointSetting = ciEntryPointSetting; _url.Text = _ciEntryPointSetting.Url; _password.Text = _ciEntryPointSetting.GetPassword(); }
public ConfigureTeamCity(SirenOfShameSettings sosSettings, TeamCityCiEntryPoint teamCityCiEntryPoint, CiEntryPointSetting ciEntryPointSetting) : base(sosSettings) { _teamCityCiEntryPoint = teamCityCiEntryPoint; InitializeComponent(); _ciEntryPointSetting = ciEntryPointSetting; _url.Text = _ciEntryPointSetting.Url; _userName.Text = _ciEntryPointSetting.UserName; _password.Text = _ciEntryPointSetting.GetPassword(); Load += OnLoad; }
public Settings(SirenOfShameSettings settings) { _settings = settings; InitializeComponent(); InitializePollIntervalSection(); InitializeUpdateLocationSection(); InitializeReputationAndAchievementSection(); _viewLog.Enabled = Program.Form.CanViewLogs; }
public virtual void BuildStatusChanged(SirenOfShameSettings settings, IList<BuildStatus> changedBuildStatuses, List<InstanceUserDto> changedUsers) { WebClientXml webClientXml = new WebClientXml(); AddSosOnlineCredentials(settings, webClientXml); webClientXml.Add("ChangedBuildStatuses", JsonConvert.SerializeObject(changedBuildStatuses)); webClientXml.Add("ChangedUsers", JsonConvert.SerializeObject(changedUsers)); if (settings.SoftwareInstanceId.HasValue) webClientXml.Add("SoftwareInstanceId", settings.SoftwareInstanceId.Value.ToString(CultureInfo.InvariantCulture)); string url = SOS_URL + "/ApiV1/BuildStatusChangedV1"; webClientXml.UploadValuesAndReturnStringAsync(url, ReadResult, ex => _log.Error("Error publishing to: " + url, ex), settings.GetSosOnlineProxy()); }
public static bool Show(SirenOfShameSettings settings) { ConfigureServers configureServers = new ConfigureServers(settings); if (!settings.CiEntryPointSettings.Any()) { configureServers.AddServer(); return true; } bool anyChanges = configureServers.ShowDialog() == DialogResult.OK; return anyChanges; }
private static void UpdateStatsInSettings(BuildStatus buildStatus, SirenOfShameSettings settings) { if (string.IsNullOrEmpty(buildStatus.RequestedBy)) return; var personSetting = settings.FindAddPerson(buildStatus.RequestedBy); if (buildStatus.BuildStatusEnum == BuildStatusEnum.Broken) { personSetting.FailedBuilds++; } personSetting.TotalBuilds++; settings.Save(); }
public void ExportNewBuilds_InitialExportWithNoBuilds_Null() { SosDbFake sosDb = new SosDbFake(); SirenOfShameSettings settings = new SirenOfShameSettings(useMef: false) { SosOnlineHighWaterMark = null, MyRawName = "CurrentUser" }; sosDb.Write(new BuildStatus { BuildDefinitionId = "BD"}, settings); var result = sosDb.ExportNewBuilds(settings); Assert.IsNull(result); }
public virtual void BuildStatusChanged(SirenOfShameSettings settings, IList<BuildStatus> changedBuildStatuses, List<InstanceUserDto> changedUsers) { try { SendNewCustomImages(settings, changedUsers); } catch (Exception ex) { _log.Error("Unable to sync custom images. Carrying on with life. Pretending this is normal.", ex); } SendBuildStatusChanged(settings, changedBuildStatuses, changedUsers); }
public static void ShowForm(SirenOfShameSettings settings, AchievementLookup achievement, PersonSetting person, IWin32Window owner, bool modal) { var newAchievement = new NewAchievement(settings, achievement, person); if (modal) { newAchievement.ShowDialog(owner); } else { newAchievement.Show(owner); } }
public ConfigureTfs(SirenOfShameSettings settings, TfsCiEntryPoint tfsCiEntryPoint, CiEntryPointSetting ciEntryPointSetting) : base(settings) { _tfsCiEntryPoint = tfsCiEntryPoint; InitializeComponent(); _ciEntryPointSetting = ciEntryPointSetting; _url.Text = _ciEntryPointSetting.Url; someoneElse.Checked = !string.IsNullOrEmpty(_ciEntryPointSetting.UserName); username.Text = _ciEntryPointSetting.UserName; password.Text = _ciEntryPointSetting.GetPassword(); DataBindAsync(); }
public IEnumerable <string> PeopleMinusUserMappings(SirenOfShameSettings settings) { return(People.Where(person => UserMappingsDoNotContain(settings, person))); }
public IEnumerable <AchievementLookup> CalculateNewAchievements(SirenOfShameSettings settings, BuildStatus build, List <BuildStatus> allActiveBuildDefinitionsOrderedChronoligically) { return(from achievementEnum in CalculateNewAchievementEnums(settings, build, allActiveBuildDefinitionsOrderedChronoligically) join achievement in AchievementSetting.AchievementLookups on achievementEnum equals achievement.Id select achievement); }
private static bool UserMappingsDoNotContain(SirenOfShameSettings settings, string person) { return(settings.UserMappings.All(um => um.WhenISee != person)); }
public virtual WatcherBase GetWatcher(SirenOfShameSettings settings) { var ciEntryPoint = GetCiEntryPoint(settings); return(ciEntryPoint.GetWatcher(settings)); }