コード例 #1
0
 public void RefreshDisplayNames(SirenOfShameSettings settings)
 {
     foreach (var buildStatusDto in BuildStatusDtos)
     {
         buildStatusDto.SetDisplayName(settings);
     }
 }
コード例 #2
0
        public ConfigureSounds(SirenOfShameSettings settings)
        {
            _settings = settings;
            InitializeComponent();

            RefreshSoundList();
        }
コード例 #3
0
ファイル: SosDb.cs プロジェクト: jonca/SirenOfShame
        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();
        }
コード例 #4
0
 public ConfigureSosOnline(SirenOfShameSettings settings)
 {
     _settings = settings;
     InitializeComponent();
     _alwaysOffline.Checked = _settings.SosOnlineAlwaysOffline;
     LoadChildControl();
 }
コード例 #5
0
ファイル: AddRule.cs プロジェクト: ramalama/SirenOfShame
        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();
        }
コード例 #6
0
ファイル: RulesEngine.cs プロジェクト: jonca/SirenOfShame
 public RulesEngine(SirenOfShameSettings settings)
 {
     ResetPreviousWorkingOrBrokenStatuses();
     _settings = settings;
     _timer.Interval = 1000;
     _timer.Tick += TimerTick;
 }
コード例 #7
0
        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;
        }
コード例 #8
0
 public ConfigureMock(SirenOfShameSettings settings, MockCiEntryPoint mockCiEntryPoint, CiEntryPointSetting ciEntryPointSetting)
     : base(settings)
 {
     InitializeComponent();
     _mockCiEntryPoint = mockCiEntryPoint;
     _ciEntryPointSetting = ciEntryPointSetting;
 }
コード例 #9
0
 public ConfigureServers(SirenOfShameSettings settings)
 {
     _settings = settings;
     InitializeComponent();
     _servers.DataSource = settings.CiEntryPointSettings;
     _servers.DisplayMember = "Url";
 }
コード例 #10
0
        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;
        }
コード例 #11
0
 public ConfigureTravisCi(SirenOfShameSettings sosSettings, TravisCiEntryPoint travisCiEntryPoint, CiEntryPointSetting ciEntryPointSetting)
     : base(sosSettings)
 {
     _travisCiEntryPoint = travisCiEntryPoint;
     _ciEntryPointSetting = ciEntryPointSetting;
     InitializeComponent();
     LoadProjectList();
 }
コード例 #12
0
ファイル: SosDb.cs プロジェクト: dirkrombauts/SirenOfShame
 public void Write(BuildStatus buildStatus, SirenOfShameSettings settings, bool disableWritingToSosDb)
 {
     if (!disableWritingToSosDb)
     {
         AppendToFile(buildStatus);
     }
     UpdateStatsInSettings(buildStatus, settings);
 }
コード例 #13
0
 public ViewBuildSmall(BuildStatusDto buildStatusDto, SirenOfShameSettings settings)
     : base(settings)
 {
     InitializeComponent();
     InitializeLabels(buildStatusDto);
     FontChanged += OnFontChanged;
     StoreInitialFontSizes();
 }
コード例 #14
0
 public RulesEngine(SirenOfShameSettings settings)
 {
     DisableSosOnline = false;
     DisableWritingToSosDb = false;
     ResetPreviousWorkingOrBrokenStatuses();
     _settings = settings;
     _timer.Interval = 1000;
     _timer.Tick += TimerTick;
 }
コード例 #15
0
        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);
        }
コード例 #16
0
        public AddMapping(SirenOfShameSettings settings, string whenISeeDefaultRawName = null)
        {
            _settings = settings;
            InitializeComponent();

            AddPeopleToDropdowns();
            RemovePeopleThatHaveAlreadyBeenMappedFromDropdowns();
            SetWhenISeeDropdownToDefault(whenISeeDefaultRawName);
        }
コード例 #17
0
ファイル: Leaders.cs プロジェクト: dirkrombauts/SirenOfShame
        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);
            }
        }
コード例 #18
0
 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());
 }
コード例 #19
0
 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());
 }
コード例 #20
0
ファイル: SyncOnline.cs プロジェクト: jimbobTX/SirenOfShame
 public SyncOnline(SirenOfShameSettings settings)
 {
     _settings = settings;
     InitializeComponent();
     InitializeSosOnlineSection();
     InitializeProxySection();
     InitializeRadioButtons();
     _settings.InitializeUserIAm(_userIAm);
     _initializing = false;
 }
コード例 #21
0
 public ConfigureAppVeyor(SirenOfShameSettings sosSettings, AppVeyorCiEntryPoint appVeyorCiEntryPoint,
     CiEntryPointSetting ciEntryPointSetting)
     : base(sosSettings)
 {
     _appVeyorCiEntryPoint = appVeyorCiEntryPoint;
     InitializeComponent();
     _ciEntryPointSetting = ciEntryPointSetting;
     _url.Text = _ciEntryPointSetting.Url;
     _password.Text = _ciEntryPointSetting.GetPassword();
 }
コード例 #22
0
 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;
 }
コード例 #23
0
ファイル: Settings.cs プロジェクト: mightymuke/SirenOfShame
        public Settings(SirenOfShameSettings settings)
        {
            _settings = settings;
            InitializeComponent();

            InitializePollIntervalSection();
            InitializeUpdateLocationSection();
            InitializeReputationAndAchievementSection();

            _viewLog.Enabled = Program.Form.CanViewLogs;
        }
コード例 #24
0
 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());
 }
コード例 #25
0
 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;
 }
コード例 #26
0
ファイル: SosDb.cs プロジェクト: dirkrombauts/SirenOfShame
 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();
 }
コード例 #27
0
ファイル: SosDbTest.cs プロジェクト: mightymuke/SirenOfShame
 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);
 }
コード例 #28
0
 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);
 }
コード例 #29
0
 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);
     }
 }
コード例 #30
0
ファイル: ConfigureTfs.cs プロジェクト: jimbobTX/SirenOfShame
 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();
 }
コード例 #31
0
 public IEnumerable <string> PeopleMinusUserMappings(SirenOfShameSettings settings)
 {
     return(People.Where(person => UserMappingsDoNotContain(settings, person)));
 }
コード例 #32
0
 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);
 }
コード例 #33
0
 private static bool UserMappingsDoNotContain(SirenOfShameSettings settings, string person)
 {
     return(settings.UserMappings.All(um => um.WhenISee != person));
 }
コード例 #34
0
        public virtual WatcherBase GetWatcher(SirenOfShameSettings settings)
        {
            var ciEntryPoint = GetCiEntryPoint(settings);

            return(ciEntryPoint.GetWatcher(settings));
        }