private void editFontColorToolStripMenuItem_Click(object sender, EventArgs e) { if (TryPromptColor(_settings.Color, out var color)) { lock (_updateSync) { _settings.Color = color; _settings.Save(); } } }
internal HeartRateForm( IHeartRateService service, string settingsFilename, DateTime now) { try { _settings = HeartRateSettings.CreateDefault(settingsFilename); LoadSettingsLocked(); _settings.Save(); _service = service; _startedAt = now; _iconBitmap = new Bitmap(_iconWidth, _iconHeight); _iconGraphics = Graphics.FromImage(_iconBitmap); _measurementFont = new Font( _settings.FontName, _iconWidth, GraphicsUnit.Pixel); _watchdog = new HeartRateServiceWatchdog( TimeSpan.FromSeconds(10), _service); InitializeComponent(); FormBorderStyle = _settings.Sizable ? FormBorderStyle.Sizable : FormBorderStyle.SizableToolWindow; // EB: Locator.CurrentMutable.RegisterLazySingleton(() => new SettingsServiceImplementation(), typeof(ISettingsServiceImplementation)); Locator.CurrentMutable.RegisterLazySingleton(() => new DependencyService(), typeof(IDependencyService)); Locator.CurrentMutable.RegisterLazySingleton(() => new SettingsService(), typeof(ISettingsService)); Locator.CurrentMutable.RegisterLazySingleton(() => new NeuronClient(), typeof(INeuronClient)); this.neuronApplicationService = new NeuronApplicationService(); } catch { TryDispose(service); throw; } }