static void openSettings() { // Another instance of the app is already running. Instead of running, send // a message thru the service so the main app opens it's windows. var service = new Service.Client(); service.SendAsync(new Service.Event("open")).GetAwaiter().GetResult(); }
private string State = StateStopped; // Last known state public SettingsForm() { InitializeComponent(); Hide(); service = new Service.Client(); service.EventReceived += Service_EventReceived; service.Connected += Service_Connected; Properties.Settings.Default.SettingsSaving += Default_SettingsSaving; service.Connect(); configuration.Text = Properties.Settings.Default.Configuration; reportDeviceName.Checked = Properties.Settings.Default.ReportDeviceName; checkUpdate.Checked = Properties.Settings.Default.CheckUpdates; updateChannel.SelectedIndex = Properties.Settings.Default.UpdateChannel == "Stable" ? 0 : 1; if (Properties.Settings.Default.Configuration.Length == 0) { Show(); } }