public override void LoadSettings(DownDetectorSettings settings) { intervalTimeSpanPicker.Value = settings.Interval; unstableIntervalTimeSpanPicker.Value = settings.UnstableInterval; displayCountNumericUpDown.Value = settings.MaximumDisplayItems; showNotificationsCheckBox.Checked = settings.ShowNotifications; startWithWindowsCheckBox.Checked = StartupManager.IsRegisteredForStartup(); showMenuItemsCheckBox.Checked = settings.ShowDisplayItems; offlineOnlyCheckBox.Checked = settings.ShowOfflineItemsOnly; maximumRedirectsNumericUpDown.Value = settings.MaximumRedirects; logDatesAsUtcCheckBox.Checked = settings.LogDatesAsUtc; base.LoadSettings(settings); }
private void UpdateStartupSetting() { try { if (StartupManager.IsRegisteredForStartup() != startWithWindowsCheckBox.Checked) { if (startWithWindowsCheckBox.Checked) { StartupManager.RegisterStartupApplication(); } else { StartupManager.UnregisterStartupApplication(); } } } catch (Exception ex) { MessageBox.Show(string.Format("Failed to process startup changes. {0}", ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }