public EditTrigger(ITrigger trigger) { _trigger = trigger; InitializeComponent(); Text = trigger.TypeAspect.CapitalizeEx() + " Trigger"; trigger.Configs.ToList() .ForEach(x => SettingsLayout.Controls.Add(x.ControlHandle)); trigger.GetNotifiers().ToList() .ForEach(AddConfigurator); }
private void AddNotificationButton_Click(object sender, EventArgs e) { IEnumerable <INotifier> restrictNotifiers = _trigger.GetNotifiers(); var ui = new ChooseNotifierType(_trigger, restrictNotifiers, trayPopups, soundManager); if (ui.ShowDialogCenteredOnForm(this) == DialogResult.OK) { _trigger.AddNotifier(ui.Result); AddConfigurator(ui.Result); } }
public EditTrigger( ITrigger trigger, [NotNull] ISoundManager soundManager, [NotNull] ITrayPopups trayPopups) { if (soundManager == null) { throw new ArgumentNullException(nameof(soundManager)); } if (trayPopups == null) { throw new ArgumentNullException(nameof(trayPopups)); } _trigger = trigger; this.soundManager = soundManager; this.trayPopups = trayPopups; InitializeComponent(); Text = trigger.TypeAspect.Capitalize() + " Trigger"; trigger.Configs.ToList() .ForEach(x => SettingsLayout.Controls.Add(x.ControlHandle)); trigger.GetNotifiers().ToList() .ForEach(AddConfigurator); }