private void SettingsForm_Load(object sender, EventArgs e) { AlwaysOnTopCheckbox.Checked = Settings.AlwaysOnTop; OpacityTrackBar.Value = (int)Math.Round(Settings.Opacity * OpacityTrackBar.Maximum); PasteStatsHotKeyBox.Key = HotKeyHelpers.FromString(Settings.HotKeys.PasteStats); ResetHotKeyBox.Key = HotKeyHelpers.FromString(Settings.HotKeys.Reset); }
public void SettingsChanged() { if (_settings.AlwaysOnTop != TopMost) { TopMost = _settings.AlwaysOnTop; } if (_settings.WindowPosition != null && IsVisibleOnScreen(new Rectangle(_settings.WindowPosition.Value.Location, new Size(100, 100)))) { DesktopLocation = _settings.WindowPosition.Value.Location; Size = _settings.WindowPosition.Value.Size; } Opacity = _settings.Opacity; alwaysOnTopToolStripMenuItem.Checked = _settings.AlwaysOnTop; if (_damageTracker != null) { _damageTracker.OnlyBosses = _settings.OnlyBosses; _damageTracker.IgnoreOneshots = _settings.IgnoreOneshots; } _pasteStatsHotKey.Key = HotKeyHelpers.FromString(_settings.HotKeys.PasteStats); _resetHotKey.Key = HotKeyHelpers.FromString(_settings.HotKeys.Reset); Fetch(); _settings.Save(); }
private void ApplyButton_Click(object sender, EventArgs e) { Settings.AlwaysOnTop = AlwaysOnTopCheckbox.Checked; Settings.Opacity = (double)OpacityTrackBar.Value / OpacityTrackBar.Maximum; Settings.HotKeys.PasteStats = HotKeyHelpers.ToString(PasteStatsHotKeyBox.Key); Settings.HotKeys.Reset = HotKeyHelpers.ToString(ResetHotKeyBox.Key); Settings.OnSettingsChanged(); }
private void ApplyButton_Click(object sender, EventArgs e) { Settings.AlwaysOnTop = AlwaysOnTopCheckbox.Checked; Settings.Opacity = (double)OpacityTrackBar.Value / OpacityTrackBar.Maximum; Settings.HotKeys.PasteStats = HotKeyHelpers.ToString(PasteStatsHotKeyBox.Key); Settings.HotKeys.Reset = HotKeyHelpers.ToString(ResetHotKeyBox.Key); Settings.BufferSize = ((KeyValuePair <int?, string>)BufferSizeComboBox.SelectedItem).Key; Settings.OnSettingsChanged(); }
private void SettingsForm_Load(object sender, EventArgs e) { var bufferSizes = new[] { null, Settings.BufferSize }.Concat(new int?[] { 1, 2, 5, 10, 20, 50 }.Select(x => x * 1000000)).Distinct(); var items = bufferSizes.Select(bufferSize => new KeyValuePair <int?, string>(bufferSize, bufferSize != null ? FormatHelpers.Pretty.FormatValue(bufferSize) + "B" : "Default")).ToList(); BufferSizeComboBox.Items.AddRange(items.Cast <object>().ToArray()); AlwaysOnTopCheckbox.Checked = Settings.AlwaysOnTop; OpacityTrackBar.Value = (int)Math.Round(Settings.Opacity * OpacityTrackBar.Maximum); PasteStatsHotKeyBox.Key = HotKeyHelpers.FromString(Settings.HotKeys.PasteStats); ResetHotKeyBox.Key = HotKeyHelpers.FromString(Settings.HotKeys.Reset); BufferSizeComboBox.SelectedItem = items.Single(x => x.Key == Settings.BufferSize); }
public void SettingsChanged() { if (_settings.AlwaysOnTop != TopMost) { TopMost = _settings.AlwaysOnTop; } Opacity = _settings.Opacity; alwaysOnTopToolStripMenuItem.Checked = _settings.AlwaysOnTop; _pasteStatsHotKey.Key = HotKeyHelpers.FromString(_settings.HotKeys.PasteStats); _resetHotKey.Key = HotKeyHelpers.FromString(_settings.HotKeys.Reset); Fetch(); _settings.Save(); }