From 4fa9774cbf77affa0f59d2af40ea08e04f762e74 Mon Sep 17 00:00:00 2001 From: XangelMusic Date: Sun, 11 Feb 2024 15:57:38 +0800 Subject: [PATCH] refactor(icon changer): added Enum file; refactor/style: cleanup --- .../ISoundSwitchConfiguration.cs | 2 +- .../Configuration/SoundSwitchConfiguration.cs | 6 +- .../Notification/NotificationBanner.cs | 1 - .../Notification/NotificationSound.cs | 4 +- .../Icon/Changer/AbstractIconChanger.cs | 28 +++++---- .../Icon/Changer/AlwaysIconChanger.cs | 23 +++++-- .../Icon/Changer/NeverIconIconChanger.cs | 27 ++++++--- .../Icon/Changer/PlaybackIconChanger.cs | 18 +++++- .../Icon/Changer/RecordingIconChanger.cs | 18 +++++- .../Framework/TrayIcon/Icon/IIconChanger.cs | 18 +++++- .../TrayIcon/Icon/IconChangerEnum.cs | 24 ++++++++ .../TrayIcon/Icon/IconChangerFactory.cs | 30 ++++++---- SoundSwitch/UI/Forms/Settings.Designer.cs | 52 ++++++++-------- SoundSwitch/UI/Forms/Settings.cs | 60 +++++++++---------- .../UI/Forms/UpdateDownloadForm.Designer.cs | 4 +- SoundSwitch/UI/Forms/UpdateDownloadForm.cs | 4 +- .../Forms/UpsertProfileExtended.Designer.cs | 30 +++++----- SoundSwitch/UI/Forms/UpsertProfileExtended.cs | 46 +++++++++----- 18 files changed, 253 insertions(+), 142 deletions(-) create mode 100644 SoundSwitch/Framework/TrayIcon/Icon/IconChangerEnum.cs diff --git a/SoundSwitch/Framework/Configuration/ISoundSwitchConfiguration.cs b/SoundSwitch/Framework/Configuration/ISoundSwitchConfiguration.cs index 0931042d9e..28c48c81e6 100644 --- a/SoundSwitch/Framework/Configuration/ISoundSwitchConfiguration.cs +++ b/SoundSwitch/Framework/Configuration/ISoundSwitchConfiguration.cs @@ -63,7 +63,7 @@ public interface ISoundSwitchConfiguration : IConfiguration /// /// What to do with the TrayIcon when changing default device /// - IconChangerFactory.ActionEnum SwitchIcon { get; set; } + IconChangerEnum SwitchIcon { get; set; } HashSet ProfileSettings { get; set; } HashSet Profiles { get; set; } diff --git a/SoundSwitch/Framework/Configuration/SoundSwitchConfiguration.cs b/SoundSwitch/Framework/Configuration/SoundSwitchConfiguration.cs index fed17060b7..61dcb35185 100644 --- a/SoundSwitch/Framework/Configuration/SoundSwitchConfiguration.cs +++ b/SoundSwitch/Framework/Configuration/SoundSwitchConfiguration.cs @@ -68,7 +68,7 @@ public SoundSwitchConfiguration() AutoAddNewConnectedDevices = false; SelectedDevices = new HashSet(); - SwitchIcon = IconChangerFactory.ActionEnum.Never; + SwitchIcon = IconChangerEnum.Never; MigratedFields = new HashSet(); } @@ -105,7 +105,7 @@ public SoundSwitchConfiguration() public bool KeepSystrayIcon { get; set; } public bool SwitchForegroundProgram { get; set; } - public IconChangerFactory.ActionEnum SwitchIcon { get; set; } + public IconChangerEnum SwitchIcon { get; set; } [Obsolete] public HashSet ProfileSettings { get; set; } = new(); @@ -176,7 +176,7 @@ public bool Migrate() #pragma warning disable 612 if (!MigratedFields.Contains(nameof(KeepSystrayIcon))) { - SwitchIcon = KeepSystrayIcon ? IconChangerFactory.ActionEnum.Never : IconChangerFactory.ActionEnum.Always; + SwitchIcon = KeepSystrayIcon ? IconChangerEnum.Never : IconChangerEnum.Always; MigratedFields.Add(nameof(KeepSystrayIcon)); migrated = true; } diff --git a/SoundSwitch/Framework/NotificationManager/Notification/NotificationBanner.cs b/SoundSwitch/Framework/NotificationManager/Notification/NotificationBanner.cs index d6ca4ef8fa..ad27b77ae1 100644 --- a/SoundSwitch/Framework/NotificationManager/Notification/NotificationBanner.cs +++ b/SoundSwitch/Framework/NotificationManager/Notification/NotificationBanner.cs @@ -23,7 +23,6 @@ using SoundSwitch.Framework.Banner.Position; using SoundSwitch.Framework.NotificationManager.Notification.Configuration; using SoundSwitch.Localization; -using SoundSwitch.Model; using SoundSwitch.Properties; namespace SoundSwitch.Framework.NotificationManager.Notification diff --git a/SoundSwitch/Framework/NotificationManager/Notification/NotificationSound.cs b/SoundSwitch/Framework/NotificationManager/Notification/NotificationSound.cs index 4c05c10db3..fb2c14e8f0 100644 --- a/SoundSwitch/Framework/NotificationManager/Notification/NotificationSound.cs +++ b/SoundSwitch/Framework/NotificationManager/Notification/NotificationSound.cs @@ -69,9 +69,7 @@ public void NotifyProfileChanged(Profile.Profile profile, Bitmap icon, uint? pro } } - public void NotifyMuteChanged(string microphoneName, bool newMuteState) - { - } + public void NotifyMuteChanged(string microphoneName, bool newMuteState) { } public void OnSoundChanged(CachedSound newSound) => Configuration.CustomSound = newSound; diff --git a/SoundSwitch/Framework/TrayIcon/Icon/Changer/AbstractIconChanger.cs b/SoundSwitch/Framework/TrayIcon/Icon/Changer/AbstractIconChanger.cs index 7405484d79..8e550e7ed7 100644 --- a/SoundSwitch/Framework/TrayIcon/Icon/Changer/AbstractIconChanger.cs +++ b/SoundSwitch/Framework/TrayIcon/Icon/Changer/AbstractIconChanger.cs @@ -1,4 +1,18 @@ -using NAudio.CoreAudioApi; +/******************************************************************** +* Copyright (C) 2015-2017 Antoine Aflalo +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +********************************************************************/ + +using NAudio.CoreAudioApi; using Serilog; using SoundSwitch.Audio.Manager; using SoundSwitch.Audio.Manager.Interop.Enum; @@ -10,20 +24,14 @@ public abstract class AbstractIconChanger : IIconChanger { private readonly ILogger _log; - protected AbstractIconChanger() - { - _log = Log.ForContext("IconChanger", TypeEnum); - } + protected AbstractIconChanger() => _log = Log.ForContext("IconChanger", TypeEnum); - public abstract IconChangerFactory.ActionEnum TypeEnum { get; } + public abstract IconChangerEnum TypeEnum { get; } public abstract string Label { get; } protected abstract DataFlow Flow { get; } - protected virtual bool NeedsToChangeIcon(DeviceInfo deviceInfo) - { - return deviceInfo.Type == Flow; - } + protected virtual bool NeedsToChangeIcon(DeviceInfo deviceInfo) => deviceInfo.Type == Flow; public void ChangeIcon(UI.Component.TrayIcon trayIcon) { diff --git a/SoundSwitch/Framework/TrayIcon/Icon/Changer/AlwaysIconChanger.cs b/SoundSwitch/Framework/TrayIcon/Icon/Changer/AlwaysIconChanger.cs index e53c610b2b..908af89237 100644 --- a/SoundSwitch/Framework/TrayIcon/Icon/Changer/AlwaysIconChanger.cs +++ b/SoundSwitch/Framework/TrayIcon/Icon/Changer/AlwaysIconChanger.cs @@ -1,4 +1,18 @@ -using NAudio.CoreAudioApi; +/******************************************************************** +* Copyright (C) 2015-2017 Antoine Aflalo +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +********************************************************************/ + +using NAudio.CoreAudioApi; using SoundSwitch.Common.Framework.Audio.Device; using SoundSwitch.Localization; @@ -6,13 +20,10 @@ namespace SoundSwitch.Framework.TrayIcon.Icon.Changer { public class AlwaysIconChanger : AbstractIconChanger { - public override IconChangerFactory.ActionEnum TypeEnum => IconChangerFactory.ActionEnum.Always; + public override IconChangerEnum TypeEnum => IconChangerEnum.Always; public override string Label => TrayIconStrings.iconChanger_both; - protected override bool NeedsToChangeIcon(DeviceInfo deviceInfo) - { - return true; - } + protected override bool NeedsToChangeIcon(DeviceInfo deviceInfo) => true; protected override DataFlow Flow => DataFlow.Render; } diff --git a/SoundSwitch/Framework/TrayIcon/Icon/Changer/NeverIconIconChanger.cs b/SoundSwitch/Framework/TrayIcon/Icon/Changer/NeverIconIconChanger.cs index 9c5619b1b8..e97fb7b8cd 100644 --- a/SoundSwitch/Framework/TrayIcon/Icon/Changer/NeverIconIconChanger.cs +++ b/SoundSwitch/Framework/TrayIcon/Icon/Changer/NeverIconIconChanger.cs @@ -1,4 +1,18 @@ -using SoundSwitch.Audio.Manager.Interop.Enum; +/******************************************************************** +* Copyright (C) 2015-2017 Antoine Aflalo +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +********************************************************************/ + +using SoundSwitch.Audio.Manager.Interop.Enum; using SoundSwitch.Common.Framework.Audio.Device; using SoundSwitch.Localization; using SoundSwitch.Properties; @@ -7,16 +21,11 @@ namespace SoundSwitch.Framework.TrayIcon.Icon.Changer { public class NeverIconIconChanger : IIconChanger { - public IconChangerFactory.ActionEnum TypeEnum => IconChangerFactory.ActionEnum.Never; + public IconChangerEnum TypeEnum => IconChangerEnum.Never; public string Label => TrayIconStrings.iconChanger_none; - public void ChangeIcon(UI.Component.TrayIcon trayIcon) - { - trayIcon.ReplaceIcon(Resources.Switch_SoundWave); - } + public void ChangeIcon(UI.Component.TrayIcon trayIcon) => trayIcon.ReplaceIcon(Resources.Switch_SoundWave); - public void ChangeIcon(UI.Component.TrayIcon trayIcon, DeviceFullInfo deviceInfo, ERole role) - { - } + public void ChangeIcon(UI.Component.TrayIcon trayIcon, DeviceFullInfo deviceInfo, ERole role) { } } } \ No newline at end of file diff --git a/SoundSwitch/Framework/TrayIcon/Icon/Changer/PlaybackIconChanger.cs b/SoundSwitch/Framework/TrayIcon/Icon/Changer/PlaybackIconChanger.cs index 5ec00f784e..1cf6c9d9fa 100644 --- a/SoundSwitch/Framework/TrayIcon/Icon/Changer/PlaybackIconChanger.cs +++ b/SoundSwitch/Framework/TrayIcon/Icon/Changer/PlaybackIconChanger.cs @@ -1,11 +1,25 @@ -using NAudio.CoreAudioApi; +/******************************************************************** +* Copyright (C) 2015-2017 Antoine Aflalo +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +********************************************************************/ + +using NAudio.CoreAudioApi; using SoundSwitch.Localization; namespace SoundSwitch.Framework.TrayIcon.Icon.Changer { public class PlaybackIconChanger : AbstractIconChanger { - public override IconChangerFactory.ActionEnum TypeEnum => IconChangerFactory.ActionEnum.Playback; + public override IconChangerEnum TypeEnum => IconChangerEnum.Playback; public override string Label => TrayIconStrings.iconChanger_playback; protected override DataFlow Flow => DataFlow.Render; } diff --git a/SoundSwitch/Framework/TrayIcon/Icon/Changer/RecordingIconChanger.cs b/SoundSwitch/Framework/TrayIcon/Icon/Changer/RecordingIconChanger.cs index b02547fcd1..6b32b5aaca 100644 --- a/SoundSwitch/Framework/TrayIcon/Icon/Changer/RecordingIconChanger.cs +++ b/SoundSwitch/Framework/TrayIcon/Icon/Changer/RecordingIconChanger.cs @@ -1,11 +1,25 @@ -using NAudio.CoreAudioApi; +/******************************************************************** +* Copyright (C) 2015-2017 Antoine Aflalo +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +********************************************************************/ + +using NAudio.CoreAudioApi; using SoundSwitch.Localization; namespace SoundSwitch.Framework.TrayIcon.Icon.Changer { public class RecordingIconChanger : AbstractIconChanger { - public override IconChangerFactory.ActionEnum TypeEnum => IconChangerFactory.ActionEnum.Recording; + public override IconChangerEnum TypeEnum => IconChangerEnum.Recording; public override string Label => TrayIconStrings.iconChanger_recording; protected override DataFlow Flow => DataFlow.Capture; } diff --git a/SoundSwitch/Framework/TrayIcon/Icon/IIconChanger.cs b/SoundSwitch/Framework/TrayIcon/Icon/IIconChanger.cs index ed67cb83d0..145666543d 100644 --- a/SoundSwitch/Framework/TrayIcon/Icon/IIconChanger.cs +++ b/SoundSwitch/Framework/TrayIcon/Icon/IIconChanger.cs @@ -1,10 +1,24 @@ -using SoundSwitch.Audio.Manager.Interop.Enum; +/******************************************************************** +* Copyright (C) 2015-2017 Antoine Aflalo +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +********************************************************************/ + +using SoundSwitch.Audio.Manager.Interop.Enum; using SoundSwitch.Common.Framework.Audio.Device; using SoundSwitch.Framework.Factory; namespace SoundSwitch.Framework.TrayIcon.Icon { - public interface IIconChanger : IEnumImpl + public interface IIconChanger : IEnumImpl { /// diff --git a/SoundSwitch/Framework/TrayIcon/Icon/IconChangerEnum.cs b/SoundSwitch/Framework/TrayIcon/Icon/IconChangerEnum.cs new file mode 100644 index 0000000000..524c961a1a --- /dev/null +++ b/SoundSwitch/Framework/TrayIcon/Icon/IconChangerEnum.cs @@ -0,0 +1,24 @@ +/******************************************************************** +* Copyright (C) 2015-2017 Antoine Aflalo +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +********************************************************************/ + +namespace SoundSwitch.Framework.TrayIcon.Icon +{ + public enum IconChangerEnum + { + Never = 0, + Recording = 1, + Playback = 2, + Always = 3 + } +} diff --git a/SoundSwitch/Framework/TrayIcon/Icon/IconChangerFactory.cs b/SoundSwitch/Framework/TrayIcon/Icon/IconChangerFactory.cs index a23ed0c143..f58f92322b 100644 --- a/SoundSwitch/Framework/TrayIcon/Icon/IconChangerFactory.cs +++ b/SoundSwitch/Framework/TrayIcon/Icon/IconChangerFactory.cs @@ -1,23 +1,29 @@ -using SoundSwitch.Framework.Factory; +/******************************************************************** +* Copyright (C) 2015-2017 Antoine Aflalo +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +********************************************************************/ + +using SoundSwitch.Framework.Factory; using SoundSwitch.Framework.TrayIcon.Icon.Changer; namespace SoundSwitch.Framework.TrayIcon.Icon { - public class IconChangerFactory : AbstractFactory + public class IconChangerFactory : AbstractFactory { - public enum ActionEnum - { - Never, - Recording, - Playback, - Always - } - - private static readonly IEnumImplList Impl = new EnumImplList() + private static readonly IEnumImplList Impl = new EnumImplList() { + new NeverIconIconChanger(), new PlaybackIconChanger(), new RecordingIconChanger(), - new NeverIconIconChanger(), new AlwaysIconChanger() }; diff --git a/SoundSwitch/UI/Forms/Settings.Designer.cs b/SoundSwitch/UI/Forms/Settings.Designer.cs index 15eeb640f1..5c724abbf5 100644 --- a/SoundSwitch/UI/Forms/Settings.Designer.cs +++ b/SoundSwitch/UI/Forms/Settings.Designer.cs @@ -115,7 +115,7 @@ private void InitializeComponent() closeButton.TabIndex = 11; closeButton.Text = "Close"; closeButton.UseVisualStyleBackColor = true; - closeButton.Click += closeButton_Click; + closeButton.Click += CloseButton_Click; // // switchCommunicationDeviceCheckBox // @@ -126,7 +126,7 @@ private void InitializeComponent() switchCommunicationDeviceCheckBox.TabIndex = 12; switchCommunicationDeviceCheckBox.Text = "Switch Default Communication Device"; switchCommunicationDeviceCheckBox.UseVisualStyleBackColor = true; - switchCommunicationDeviceCheckBox.CheckedChanged += communicationCheckbox_CheckedChanged; + switchCommunicationDeviceCheckBox.CheckedChanged += CommunicationCheckbox_CheckedChanged; // // tabControl // @@ -140,7 +140,7 @@ private void InitializeComponent() tabControl.SelectedIndex = 0; tabControl.Size = new System.Drawing.Size(896, 439); tabControl.TabIndex = 13; - tabControl.SelectedIndexChanged += tabControl_SelectedIndexChanged; + tabControl.SelectedIndexChanged += TabControl_SelectedIndexChanged; // // playbackTabPage // @@ -226,7 +226,7 @@ private void InitializeComponent() editProfileButton.Text = "Edit"; editProfileButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; editProfileButton.UseVisualStyleBackColor = true; - editProfileButton.Click += editProfileButton_Click; + editProfileButton.Click += EditProfileButton_Click; // // deleteProfileButton // @@ -240,7 +240,7 @@ private void InitializeComponent() deleteProfileButton.Text = "Delete"; deleteProfileButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; deleteProfileButton.UseVisualStyleBackColor = true; - deleteProfileButton.Click += deleteProfileButton_Click; + deleteProfileButton.Click += DeleteProfileButton_Click; // // profileExplanationLabel // @@ -264,8 +264,8 @@ private void InitializeComponent() profilesListView.TabIndex = 2; profilesListView.UseCompatibleStateImageBehavior = false; profilesListView.View = System.Windows.Forms.View.Details; - profilesListView.SelectedIndexChanged += profilesListView_SelectedIndexChanged; - profilesListView.DoubleClick += profilesListView_DoubleClick; + profilesListView.SelectedIndexChanged += ProfilesListView_SelectedIndexChanged; + profilesListView.DoubleClick += ProfilesListView_DoubleClick; // // addProfileButton // @@ -277,7 +277,7 @@ private void InitializeComponent() addProfileButton.Text = "Add"; addProfileButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; addProfileButton.UseVisualStyleBackColor = true; - addProfileButton.Click += addProfileButton_Click; + addProfileButton.Click += AddProfileButton_Click; // // appSettingTabPage // @@ -316,7 +316,7 @@ private void InitializeComponent() notificationComboBox.Name = "notificationComboBox"; notificationComboBox.Size = new System.Drawing.Size(237, 23); notificationComboBox.TabIndex = 16; - notificationComboBox.SelectedValueChanged += notificationComboBox_SelectedValueChanged; + notificationComboBox.SelectedValueChanged += NotificationComboBox_SelectedValueChanged; // // positionLabel // @@ -335,7 +335,7 @@ private void InitializeComponent() positionComboBox.Name = "positionComboBox"; positionComboBox.Size = new System.Drawing.Size(121, 23); positionComboBox.TabIndex = 17; - positionComboBox.SelectedValueChanged += positionComboBox_SelectedValueChanged; + positionComboBox.SelectedValueChanged += PositionComboBox_SelectedValueChanged; // // usePrimaryScreenCheckbox // @@ -346,7 +346,7 @@ private void InitializeComponent() usePrimaryScreenCheckbox.TabIndex = 26; usePrimaryScreenCheckbox.Text = "Always use primary screen"; usePrimaryScreenCheckbox.UseVisualStyleBackColor = true; - usePrimaryScreenCheckbox.CheckedChanged += usePrimaryScreenCheckbox_CheckedChanged; + usePrimaryScreenCheckbox.CheckedChanged += UsePrimaryScreenCheckbox_CheckedChanged; // // selectSoundButton // @@ -357,7 +357,7 @@ private void InitializeComponent() selectSoundButton.Text = "..."; selectSoundButton.UseVisualStyleBackColor = true; selectSoundButton.Visible = false; - selectSoundButton.Click += selectSoundButton_Click; + selectSoundButton.Click += SelectSoundButton_Click; // // deleteSoundButton // @@ -368,7 +368,7 @@ private void InitializeComponent() deleteSoundButton.TabIndex = 24; deleteSoundButton.UseVisualStyleBackColor = true; deleteSoundButton.Visible = false; - deleteSoundButton.Click += deleteSoundButton_Click; + deleteSoundButton.Click += DeleteSoundButton_Click; // // languageGroupBox // @@ -388,7 +388,7 @@ private void InitializeComponent() languageComboBox.Name = "languageComboBox"; languageComboBox.Size = new System.Drawing.Size(237, 23); languageComboBox.TabIndex = 17; - languageComboBox.SelectedIndexChanged += languageComboBox_SelectedIndexChanged; + languageComboBox.SelectedIndexChanged += LanguageComboBox_SelectedIndexChanged; // // updateSettingsGroupBox // @@ -424,7 +424,7 @@ private void InitializeComponent() updateNeverRadioButton.TabStop = true; updateNeverRadioButton.Text = "Never check for updates"; updateNeverRadioButton.UseVisualStyleBackColor = true; - updateNeverRadioButton.CheckedChanged += updateNeverRadioButton_CheckedChanged; + updateNeverRadioButton.CheckedChanged += UpdateNeverRadioButton_CheckedChanged; // // updateNotifyRadioButton // @@ -436,7 +436,7 @@ private void InitializeComponent() updateNotifyRadioButton.TabStop = true; updateNotifyRadioButton.Text = "Notify me when updates are available"; updateNotifyRadioButton.UseVisualStyleBackColor = true; - updateNotifyRadioButton.CheckedChanged += updateNotifyRadioButton_CheckedChanged; + updateNotifyRadioButton.CheckedChanged += UpdateNotifyRadioButton_CheckedChanged; // // updateSilentRadioButton // @@ -448,7 +448,7 @@ private void InitializeComponent() updateSilentRadioButton.TabStop = true; updateSilentRadioButton.Text = "Install updates automatically"; updateSilentRadioButton.UseVisualStyleBackColor = true; - updateSilentRadioButton.CheckedChanged += updateSilentRadioButton_CheckedChanged; + updateSilentRadioButton.CheckedChanged += UpdateSilentRadioButton_CheckedChanged; // // includeBetaVersionsCheckBox // @@ -459,7 +459,7 @@ private void InitializeComponent() includeBetaVersionsCheckBox.TabIndex = 18; includeBetaVersionsCheckBox.Text = "Include Beta versions"; includeBetaVersionsCheckBox.UseVisualStyleBackColor = true; - includeBetaVersionsCheckBox.CheckedChanged += betaVersionCheckbox_CheckedChanged; + includeBetaVersionsCheckBox.CheckedChanged += BetaVersionCheckbox_CheckedChanged; // // audioSettingsGroupBox // @@ -506,7 +506,7 @@ private void InitializeComponent() keepVolumeCheckbox.Size = new System.Drawing.Size(277, 24); keepVolumeCheckbox.TabIndex = 29; keepVolumeCheckbox.Text = "Keep volume levels across playback devices"; - keepVolumeCheckbox.CheckedChanged += keepVolumeCheckbox_CheckedChanged; + keepVolumeCheckbox.CheckedChanged += KeepVolumeCheckbox_CheckedChanged; // // foregroundAppCheckbox // @@ -536,7 +536,7 @@ private void InitializeComponent() cycleThroughComboBox.Name = "cycleThroughComboBox"; cycleThroughComboBox.Size = new System.Drawing.Size(237, 23); cycleThroughComboBox.TabIndex = 22; - cycleThroughComboBox.SelectedValueChanged += cyclerComboBox_SelectedValueChanged; + cycleThroughComboBox.SelectedValueChanged += CyclerComboBox_SelectedValueChanged; // // tooltipOnHoverLabel // @@ -555,7 +555,7 @@ private void InitializeComponent() tooltipInfoComboBox.Name = "tooltipInfoComboBox"; tooltipInfoComboBox.Size = new System.Drawing.Size(237, 23); tooltipInfoComboBox.TabIndex = 20; - tooltipInfoComboBox.SelectedValueChanged += tooltipInfoComboBox_SelectedValueChanged; + tooltipInfoComboBox.SelectedValueChanged += TooltipInfoComboBox_SelectedValueChanged; // // basicSettingsGroupBox // @@ -586,7 +586,7 @@ private void InitializeComponent() iconChangeChoicesComboBox.Name = "iconChangeChoicesComboBox"; iconChangeChoicesComboBox.Size = new System.Drawing.Size(237, 23); iconChangeChoicesComboBox.TabIndex = 26; - iconChangeChoicesComboBox.SelectedIndexChanged += iconChangeChoicesComboBox_SelectedIndexChanged; + iconChangeChoicesComboBox.SelectedIndexChanged += IconChangeChoicesComboBox_SelectedIndexChanged; // // selectSoundFileDialog // @@ -602,7 +602,7 @@ private void InitializeComponent() hotkeysCheckBox.TabIndex = 20; hotkeysCheckBox.Text = "Enable hotkey"; hotkeysCheckBox.UseVisualStyleBackColor = true; - hotkeysCheckBox.CheckedChanged += hotkeysCheckbox_CheckedChanged; + hotkeysCheckBox.CheckedChanged += HotkeysCheckbox_CheckedChanged; // // hotKeyControl // @@ -613,7 +613,7 @@ private void InitializeComponent() hotKeyControl.Size = new System.Drawing.Size(138, 23); hotKeyControl.TabIndex = 21; hotKeyControl.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - hotKeyControl.HotKeyChanged += hotKeyControl_HotKeyChanged; + hotKeyControl.HotKeyChanged += HotKeyControl_HotKeyChanged; // // toggleMuteLabel // @@ -634,7 +634,7 @@ private void InitializeComponent() muteHotKey.Size = new System.Drawing.Size(138, 23); muteHotKey.TabIndex = 24; muteHotKey.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - muteHotKey.HotKeyChanged += hotKeyControl_HotKeyChanged; + muteHotKey.HotKeyChanged += HotKeyControl_HotKeyChanged; // // muteHotKeyCheckbox // @@ -646,7 +646,7 @@ private void InitializeComponent() muteHotKeyCheckbox.TabIndex = 23; muteHotKeyCheckbox.Text = "Enable hotkey"; muteHotKeyCheckbox.UseVisualStyleBackColor = true; - muteHotKeyCheckbox.CheckedChanged += muteHotKeyCheckbox_CheckedChanged; + muteHotKeyCheckbox.CheckedChanged += MuteHotKeyCheckbox_CheckedChanged; // // SettingsForm // diff --git a/SoundSwitch/UI/Forms/Settings.cs b/SoundSwitch/UI/Forms/Settings.cs index dcee350d3f..60b50bae2f 100644 --- a/SoundSwitch/UI/Forms/Settings.cs +++ b/SoundSwitch/UI/Forms/Settings.cs @@ -371,12 +371,12 @@ private void LocalizeForm() deleteProfileButton.Image = Resources.profile_menu_delete; } - private void closeButton_Click(object sender, EventArgs e) + private void CloseButton_Click(object sender, EventArgs e) { Close(); } - private void tabControl_SelectedIndexChanged(object sender, EventArgs e) + private void TabControl_SelectedIndexChanged(object sender, EventArgs e) { var tabControlSender = (TabControl)sender; if (tabControlSender.SelectedTab == playbackTabPage) @@ -438,17 +438,17 @@ private void DeleteSoundButtonVisible(bool supportCustomSound) deleteSoundButton.Visible = supportCustomSound && AppModel.Instance.CustomNotificationSound != null; } - private void hotkeysCheckbox_CheckedChanged(object sender, EventArgs e) + private void HotkeysCheckbox_CheckedChanged(object sender, EventArgs e) { - forceSetHotkeys(sender, hotKeyControl); + ForceSetHotkeys(sender, hotKeyControl); } - private void muteHotKeyCheckbox_CheckedChanged(object sender, EventArgs e) + private void MuteHotKeyCheckbox_CheckedChanged(object sender, EventArgs e) { - forceSetHotkeys(sender, muteHotKey); + ForceSetHotkeys(sender, muteHotKey); } - private void forceSetHotkeys(object sender, HotKeyTextBox hotKeyTextBox) + private void ForceSetHotkeys(object sender, HotKeyTextBox hotKeyTextBox) { var control = (CheckBox)sender; if (hotKeyTextBox.Tag == null) return; @@ -460,7 +460,7 @@ private void forceSetHotkeys(object sender, HotKeyTextBox hotKeyTextBox) AppModel.Instance.SetHotkeyCombination(hotKey, action, true); } - private void hotKeyControl_HotKeyChanged(object sender, HotKeyTextBox.Event e) + private void HotKeyControl_HotKeyChanged(object sender, HotKeyTextBox.Event e) { var control = (HotKeyTextBox)sender; var tuple = (Tuple)control.Tag; @@ -600,19 +600,19 @@ private void PopulateDeviceTypeGroups(ListView listView) #region Profiles - private void addProfileButton_Click(object sender, EventArgs e) + private void AddProfileButton_Click(object sender, EventArgs e) { var form = new UpsertProfileExtended(new Profile(), _audioDeviceLister.GetDevices(DataFlow.Render, DeviceState.Active | DeviceState.Unplugged), _audioDeviceLister.GetDevices(DataFlow.Capture, DeviceState.Active | DeviceState.Unplugged), this); form.Show(this); } - private void profilesListView_SelectedIndexChanged(object sender, EventArgs e) + private void ProfilesListView_SelectedIndexChanged(object sender, EventArgs e) { editProfileButton.Enabled = profilesListView.SelectedIndices.Count == 1; deleteProfileButton.Enabled = profilesListView.SelectedIndices.Count > 0; } - private void deleteProfileButton_Click(object sender, EventArgs e) + private void DeleteProfileButton_Click(object sender, EventArgs e) { if (profilesListView.SelectedItems.Count <= 0) { @@ -627,7 +627,7 @@ private void deleteProfileButton_Click(object sender, EventArgs e) RefreshProfiles(); } - private void editProfileButton_Click(object sender, EventArgs e) + private void EditProfileButton_Click(object sender, EventArgs e) { if (profilesListView.SelectedItems.Count <= 0) { @@ -639,9 +639,9 @@ private void editProfileButton_Click(object sender, EventArgs e) form.Show(this); } - private void profilesListView_DoubleClick(object sender, EventArgs e) + private void ProfilesListView_DoubleClick(object sender, EventArgs e) { - editProfileButton_Click(sender, e); + EditProfileButton_Click(sender, e); } #endregion @@ -662,13 +662,13 @@ private void RunAtStartup_CheckedChanged(object sender, EventArgs e) } } - private void iconChangeChoicesComboBox_SelectedIndexChanged(object sender, EventArgs e) + private void IconChangeChoicesComboBox_SelectedIndexChanged(object sender, EventArgs e) { if (!_loaded) return; var comboBox = (ComboBox)sender; if (comboBox == null) return; - var item = (DisplayEnumObject)iconChangeChoicesComboBox.SelectedItem; + var item = (DisplayEnumObject)iconChangeChoicesComboBox.SelectedItem; AppConfigs.Configuration.SwitchIcon = item.Enum; AppConfigs.Configuration.Save(); @@ -679,7 +679,7 @@ private void iconChangeChoicesComboBox_SelectedIndexChanged(object sender, Event #region Audio Settings - private void communicationCheckbox_CheckedChanged(object sender, EventArgs e) + private void CommunicationCheckbox_CheckedChanged(object sender, EventArgs e) { var comm = switchCommunicationDeviceCheckBox.Checked; try @@ -698,12 +698,12 @@ private void ForegroundAppCheckbox_CheckedChanged(object sender, EventArgs e) AppModel.Instance.SwitchForegroundProgram = foregroundAppCheckbox.Checked; } - private void keepVolumeCheckbox_CheckedChanged(object sender, EventArgs e) + private void KeepVolumeCheckbox_CheckedChanged(object sender, EventArgs e) { AppModel.Instance.KeepVolumeEnabled = keepVolumeCheckbox.Checked; } - private void tooltipInfoComboBox_SelectedValueChanged(object sender, EventArgs e) + private void TooltipInfoComboBox_SelectedValueChanged(object sender, EventArgs e) { if (!_loaded) return; var value = (DisplayEnumObject)((ComboBox)sender).SelectedItem; @@ -712,7 +712,7 @@ private void tooltipInfoComboBox_SelectedValueChanged(object sender, EventArgs e TooltipInfoManager.CurrentTooltipInfo = value.Enum; } - private void cyclerComboBox_SelectedValueChanged(object sender, EventArgs e) + private void CyclerComboBox_SelectedValueChanged(object sender, EventArgs e) { if (!_loaded) return; var value = (DisplayEnumObject)((ComboBox)sender).SelectedItem; @@ -725,7 +725,7 @@ private void cyclerComboBox_SelectedValueChanged(object sender, EventArgs e) #region Update Settings - private void updateSilentRadioButton_CheckedChanged(object sender, EventArgs e) + private void UpdateSilentRadioButton_CheckedChanged(object sender, EventArgs e) { if (updateSilentRadioButton.Checked) { @@ -733,7 +733,7 @@ private void updateSilentRadioButton_CheckedChanged(object sender, EventArgs e) } } - private void updateNotifyRadioButton_CheckedChanged(object sender, EventArgs e) + private void UpdateNotifyRadioButton_CheckedChanged(object sender, EventArgs e) { if (updateNotifyRadioButton.Checked) { @@ -741,7 +741,7 @@ private void updateNotifyRadioButton_CheckedChanged(object sender, EventArgs e) } } - private void updateNeverRadioButton_CheckedChanged(object sender, EventArgs e) + private void UpdateNeverRadioButton_CheckedChanged(object sender, EventArgs e) { if (updateNeverRadioButton.Checked) { @@ -749,7 +749,7 @@ private void updateNeverRadioButton_CheckedChanged(object sender, EventArgs e) } } - private void betaVersionCheckbox_CheckedChanged(object sender, EventArgs e) + private void BetaVersionCheckbox_CheckedChanged(object sender, EventArgs e) { AppModel.Instance.IncludeBetaVersions = includeBetaVersionsCheckBox.Checked; } @@ -758,7 +758,7 @@ private void betaVersionCheckbox_CheckedChanged(object sender, EventArgs e) #region Language - private void languageComboBox_SelectedIndexChanged(object sender, EventArgs e) + private void LanguageComboBox_SelectedIndexChanged(object sender, EventArgs e) { if (!_loaded) return; var value = (DisplayEnumObject)((ComboBox)sender).SelectedItem; @@ -778,7 +778,7 @@ private void languageComboBox_SelectedIndexChanged(object sender, EventArgs e) #region Notification - private void notificationComboBox_SelectedValueChanged(object sender, EventArgs e) + private void NotificationComboBox_SelectedValueChanged(object sender, EventArgs e) { if (!_loaded) return; var value = (DisplayEnumObject)((ComboBox)sender).SelectedItem; @@ -796,7 +796,7 @@ private void notificationComboBox_SelectedValueChanged(object sender, EventArgs AppModel.Instance.NotificationSettings = notificationType; } - private void positionComboBox_SelectedValueChanged(object sender, EventArgs e) + private void PositionComboBox_SelectedValueChanged(object sender, EventArgs e) { if (!_loaded) return; var value = (DisplayEnumObject)((ComboBox)sender).SelectedItem; @@ -805,18 +805,18 @@ private void positionComboBox_SelectedValueChanged(object sender, EventArgs e) AppModel.Instance.BannerPosition = value.Enum; } - private void selectSoundButton_Click(object sender, EventArgs e) + private void SelectSoundButton_Click(object sender, EventArgs e) { selectSoundFileDialog.ShowDialog(this); } - private void deleteSoundButton_Click(object sender, EventArgs e) + private void DeleteSoundButton_Click(object sender, EventArgs e) { AppModel.Instance.CustomNotificationSound = null; deleteSoundButton.Visible = false; } - private void usePrimaryScreenCheckbox_CheckedChanged(object sender, EventArgs e) + private void UsePrimaryScreenCheckbox_CheckedChanged(object sender, EventArgs e) { AppModel.Instance.NotifyUsingPrimaryScreen = usePrimaryScreenCheckbox.Checked; } diff --git a/SoundSwitch/UI/Forms/UpdateDownloadForm.Designer.cs b/SoundSwitch/UI/Forms/UpdateDownloadForm.Designer.cs index 4d53042d9c..ca3f0d9eb3 100644 --- a/SoundSwitch/UI/Forms/UpdateDownloadForm.Designer.cs +++ b/SoundSwitch/UI/Forms/UpdateDownloadForm.Designer.cs @@ -75,7 +75,7 @@ private void InitializeComponent() this.cancelButton.TabIndex = 2; this.cancelButton.Text = "Cancel"; this.cancelButton.UseVisualStyleBackColor = true; - this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + this.cancelButton.Click += new System.EventHandler(this.CancelButton_Click); // // installButton // @@ -87,7 +87,7 @@ private void InitializeComponent() this.installButton.TabIndex = 3; this.installButton.Text = "Install"; this.installButton.UseVisualStyleBackColor = true; - this.installButton.Click += new System.EventHandler(this.installButton_Click); + this.installButton.Click += new System.EventHandler(this.InstallButton_Click); // // downloadProgress // diff --git a/SoundSwitch/UI/Forms/UpdateDownloadForm.cs b/SoundSwitch/UI/Forms/UpdateDownloadForm.cs index befb574a53..a832de95af 100644 --- a/SoundSwitch/UI/Forms/UpdateDownloadForm.cs +++ b/SoundSwitch/UI/Forms/UpdateDownloadForm.cs @@ -115,7 +115,7 @@ private void LocalizeForm() installButton.Text = UpdateDownloadStrings.install; } - private void cancelButton_Click(object sender, EventArgs e) + private void CancelButton_Click(object sender, EventArgs e) { if (_releaseFile.DownloadStarted) { @@ -129,7 +129,7 @@ private void cancelButton_Click(object sender, EventArgs e) Close(); } - private void installButton_Click(object sender, EventArgs e) + private void InstallButton_Click(object sender, EventArgs e) { downloadProgress.Enabled = true; downloadProgress.Visible = true; diff --git a/SoundSwitch/UI/Forms/UpsertProfileExtended.Designer.cs b/SoundSwitch/UI/Forms/UpsertProfileExtended.Designer.cs index cb44c14102..49aa2d14f7 100644 --- a/SoundSwitch/UI/Forms/UpsertProfileExtended.Designer.cs +++ b/SoundSwitch/UI/Forms/UpsertProfileExtended.Designer.cs @@ -115,7 +115,7 @@ private void InitializeComponent() this.selectProgramButton.TabIndex = 9; this.selectProgramButton.Text = "..."; this.selectProgramButton.UseVisualStyleBackColor = true; - this.selectProgramButton.Click += new System.EventHandler(this.selectProgramButton_Click); + this.selectProgramButton.Click += new System.EventHandler(this.SelectProgramButton_Click); // // descriptionBox // @@ -164,7 +164,7 @@ private void InitializeComponent() this.deleteButton.TabIndex = 5; this.deleteButton.Text = "Remove"; this.deleteButton.UseVisualStyleBackColor = true; - this.deleteButton.Click += new System.EventHandler(this.deleteButton_Click); + this.deleteButton.Click += new System.EventHandler(this.DeleteButton_Click); // // hotKeyControl // @@ -204,7 +204,7 @@ private void InitializeComponent() this.addTriggerButton.TabIndex = 2; this.addTriggerButton.Text = "Add"; this.addTriggerButton.UseVisualStyleBackColor = true; - this.addTriggerButton.Click += new System.EventHandler(this.addTriggerButton_Click); + this.addTriggerButton.Click += new System.EventHandler(this.AddTriggerButton_Click); // // availableTriggersText // @@ -227,7 +227,7 @@ private void InitializeComponent() this.setTriggerBox.Name = "setTriggerBox"; this.setTriggerBox.Size = new System.Drawing.Size(288, 109); this.setTriggerBox.TabIndex = 0; - this.setTriggerBox.SelectedIndexChanged += new System.EventHandler(this.setTriggerBox_SelectedIndexChanged); + this.setTriggerBox.SelectedIndexChanged += new System.EventHandler(this.SetTriggerBox_SelectedIndexChanged); // // restoreDevicesCheckBox // @@ -239,7 +239,7 @@ private void InitializeComponent() this.restoreDevicesCheckBox.TabIndex = 11; this.restoreDevicesCheckBox.Text = "Restore devices"; this.restoreDevicesCheckBox.UseVisualStyleBackColor = true; - this.restoreDevicesCheckBox.CheckedChanged += new System.EventHandler(this.restoreDevicesCheckBox_CheckedChanged); + this.restoreDevicesCheckBox.CheckedChanged += new System.EventHandler(this.RestoreDevicesCheckBox_CheckedChanged); // // profileBox // @@ -307,7 +307,7 @@ private void InitializeComponent() this.switchDefaultCheckBox.TabIndex = 22; this.switchDefaultCheckBox.Text = "Also switch default device"; this.switchDefaultCheckBox.UseVisualStyleBackColor = true; - this.switchDefaultCheckBox.CheckedChanged += new System.EventHandler(this.switchDefaultCheckBox_CheckedChanged); + this.switchDefaultCheckBox.CheckedChanged += new System.EventHandler(this.SwitchDefaultCheckBox_CheckedChanged); // // recordingRemoveButton // @@ -320,7 +320,7 @@ private void InitializeComponent() this.recordingRemoveButton.TabIndex = 21; this.recordingRemoveButton.UseVisualStyleBackColor = true; this.recordingRemoveButton.Visible = false; - this.recordingRemoveButton.Click += new System.EventHandler(this.recordingRemoveButton_Click); + this.recordingRemoveButton.Click += new System.EventHandler(this.RecordingRemoveButton_Click); // // playbackRemoveButton // @@ -333,7 +333,7 @@ private void InitializeComponent() this.playbackRemoveButton.TabIndex = 20; this.playbackRemoveButton.UseVisualStyleBackColor = true; this.playbackRemoveButton.Visible = false; - this.playbackRemoveButton.Click += new System.EventHandler(this.playbackRemoveButton_Click); + this.playbackRemoveButton.Click += new System.EventHandler(this.PlaybackRemoveButton_Click); // // recordingLabel // @@ -374,7 +374,7 @@ private void InitializeComponent() this.recordingComboBox.Size = new System.Drawing.Size(610, 24); this.recordingComboBox.TabIndex = 17; this.recordingComboBox.ValueMember = "Tag"; - this.recordingComboBox.SelectedIndexChanged += new System.EventHandler(this.recordingComboBox_SelectedIndexChanged); + this.recordingComboBox.SelectedIndexChanged += new System.EventHandler(this.RecordingComboBox_SelectedIndexChanged); // // playbackComboBox // @@ -391,7 +391,7 @@ private void InitializeComponent() this.playbackComboBox.Size = new System.Drawing.Size(610, 24); this.playbackComboBox.TabIndex = 16; this.playbackComboBox.ValueMember = "Tag"; - this.playbackComboBox.SelectedIndexChanged += new System.EventHandler(this.playbackComboBox_SelectedIndexChanged); + this.playbackComboBox.SelectedIndexChanged += new System.EventHandler(this.PlaybackComboBox_SelectedIndexChanged); // // communicationRecordingRemoveButton // @@ -404,7 +404,7 @@ private void InitializeComponent() this.communicationRecordingRemoveButton.TabIndex = 31; this.communicationRecordingRemoveButton.UseVisualStyleBackColor = true; this.communicationRecordingRemoveButton.Visible = false; - this.communicationRecordingRemoveButton.Click += new System.EventHandler(this.communicationRecordingRemoveButton_Click); + this.communicationRecordingRemoveButton.Click += new System.EventHandler(this.CommunicationRecordingRemoveButton_Click); // // communicationRecordingLabel // @@ -433,7 +433,7 @@ private void InitializeComponent() this.communicationRecordingComboBox.Size = new System.Drawing.Size(613, 24); this.communicationRecordingComboBox.TabIndex = 29; this.communicationRecordingComboBox.ValueMember = "Tag"; - this.communicationRecordingComboBox.SelectedIndexChanged += new System.EventHandler(this.communicationRecordingComboBox_SelectedIndexChanged); + this.communicationRecordingComboBox.SelectedIndexChanged += new System.EventHandler(this.CommunicationRecordingComboBox_SelectedIndexChanged); // // communicationRemoveButton // @@ -446,7 +446,7 @@ private void InitializeComponent() this.communicationRemoveButton.TabIndex = 25; this.communicationRemoveButton.UseVisualStyleBackColor = true; this.communicationRemoveButton.Visible = false; - this.communicationRemoveButton.Click += new System.EventHandler(this.communicationRemoveButton_Click); + this.communicationRemoveButton.Click += new System.EventHandler(this.CommunicationRemoveButton_Click); // // communicationLabel // @@ -475,7 +475,7 @@ private void InitializeComponent() this.communicationComboBox.Size = new System.Drawing.Size(613, 24); this.communicationComboBox.TabIndex = 23; this.communicationComboBox.ValueMember = "Tag"; - this.communicationComboBox.SelectedIndexChanged += new System.EventHandler(this.communicationComboBox_SelectedIndexChanged); + this.communicationComboBox.SelectedIndexChanged += new System.EventHandler(this.CommunicationComboBox_SelectedIndexChanged); // // saveButton // @@ -487,7 +487,7 @@ private void InitializeComponent() this.saveButton.TabIndex = 2; this.saveButton.Text = "Save"; this.saveButton.UseVisualStyleBackColor = true; - this.saveButton.Click += new System.EventHandler(this.saveButton_Click); + this.saveButton.Click += new System.EventHandler(this.SaveButton_Click); // // communicationBox // diff --git a/SoundSwitch/UI/Forms/UpsertProfileExtended.cs b/SoundSwitch/UI/Forms/UpsertProfileExtended.cs index 6030daf6a1..64253d8cd5 100644 --- a/SoundSwitch/UI/Forms/UpsertProfileExtended.cs +++ b/SoundSwitch/UI/Forms/UpsertProfileExtended.cs @@ -1,4 +1,18 @@ -using System; +/******************************************************************** +* Copyright (C) 2015-2017 Antoine Aflalo +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +********************************************************************/ + +using System; using System.Collections.Generic; using System.Drawing; using System.Linq; @@ -173,7 +187,7 @@ private void InitializeAvailableTriggers() } } - private void addTriggerButton_Click(object sender, EventArgs e) + private void AddTriggerButton_Click(object sender, EventArgs e) { if (availableTriggerBox.SelectedItem == null) { @@ -187,7 +201,7 @@ private void addTriggerButton_Click(object sender, EventArgs e) InitializeAvailableTriggers(); } - private void setTriggerBox_SelectedIndexChanged(object sender, EventArgs e) + private void SetTriggerBox_SelectedIndexChanged(object sender, EventArgs e) { if (setTriggerBox.SelectedItem == null) { @@ -247,7 +261,7 @@ private void HideTriggerComponents() } } - private void deleteButton_Click(object sender, EventArgs e) + private void DeleteButton_Click(object sender, EventArgs e) { if (setTriggerBox.SelectedItem == null) { @@ -271,14 +285,14 @@ private void deleteButton_Click(object sender, EventArgs e) } } - private void selectProgramButton_Click(object sender, EventArgs e) + private void SelectProgramButton_Click(object sender, EventArgs e) { if (selectProgramDialog.ShowDialog(this) != DialogResult.OK) return; textInput.Text = selectProgramDialog.FileName; } - private void playbackComboBox_SelectedIndexChanged(object sender, EventArgs e) + private void PlaybackComboBox_SelectedIndexChanged(object sender, EventArgs e) { if (playbackComboBox.SelectedIndex == -1) { @@ -289,7 +303,7 @@ private void playbackComboBox_SelectedIndexChanged(object sender, EventArgs e) playbackRemoveButton.Visible = true; } - private void communicationRecordingComboBox_SelectedIndexChanged(object sender, EventArgs e) + private void CommunicationRecordingComboBox_SelectedIndexChanged(object sender, EventArgs e) { if (communicationRecordingComboBox.SelectedIndex == -1) { @@ -300,7 +314,7 @@ private void communicationRecordingComboBox_SelectedIndexChanged(object sender, communicationRecordingRemoveButton.Visible = true; } - private void recordingComboBox_SelectedIndexChanged(object sender, EventArgs e) + private void RecordingComboBox_SelectedIndexChanged(object sender, EventArgs e) { if (recordingComboBox.SelectedIndex == -1) { @@ -311,7 +325,7 @@ private void recordingComboBox_SelectedIndexChanged(object sender, EventArgs e) recordingRemoveButton.Visible = true; } - private void communicationComboBox_SelectedIndexChanged(object sender, EventArgs e) + private void CommunicationComboBox_SelectedIndexChanged(object sender, EventArgs e) { if (communicationComboBox.SelectedIndex == -1) { @@ -322,7 +336,7 @@ private void communicationComboBox_SelectedIndexChanged(object sender, EventArgs communicationRemoveButton.Visible = true; } - private void playbackRemoveButton_Click(object sender, EventArgs e) + private void PlaybackRemoveButton_Click(object sender, EventArgs e) { _profile.Playback = null; try @@ -337,7 +351,7 @@ private void playbackRemoveButton_Click(object sender, EventArgs e) playbackRemoveButton.Visible = false; } - private void recordingRemoveButton_Click(object sender, EventArgs e) + private void RecordingRemoveButton_Click(object sender, EventArgs e) { _profile.Recording = null; try @@ -352,7 +366,7 @@ private void recordingRemoveButton_Click(object sender, EventArgs e) recordingRemoveButton.Visible = false; } - private void communicationRemoveButton_Click(object sender, EventArgs e) + private void CommunicationRemoveButton_Click(object sender, EventArgs e) { _profile.Communication = null; try @@ -367,7 +381,7 @@ private void communicationRemoveButton_Click(object sender, EventArgs e) communicationRemoveButton.Visible = false; } - private void communicationRecordingRemoveButton_Click(object sender, EventArgs e) + private void CommunicationRecordingRemoveButton_Click(object sender, EventArgs e) { _profile.RecordingCommunication = null; try @@ -382,7 +396,7 @@ private void communicationRecordingRemoveButton_Click(object sender, EventArgs e communicationRecordingRemoveButton.Visible = false; } - private void saveButton_Click(object sender, EventArgs e) + private void SaveButton_Click(object sender, EventArgs e) { var result = _editing ? AppModel.Instance.ProfileManager.UpdateProfile(_oldProfile, _profile) : AppModel.Instance.ProfileManager.AddProfile(_profile); @@ -400,7 +414,7 @@ private void saveButton_Click(object sender, EventArgs e) }); } - private void restoreDevicesCheckBox_CheckedChanged(object sender, EventArgs e) + private void RestoreDevicesCheckBox_CheckedChanged(object sender, EventArgs e) { if (_profile.AlsoSwitchDefaultDevice || !restoreDevicesCheckBox.Checked) return; @@ -414,7 +428,7 @@ protected override void OnFormClosing(FormClosingEventArgs e) base.OnFormClosing(e); } - private void switchDefaultCheckBox_CheckedChanged(object sender, EventArgs e) + private void SwitchDefaultCheckBox_CheckedChanged(object sender, EventArgs e) { if (switchDefaultCheckBox.Checked) {