From ce60cb101adcc7645ad46133a8715d29f9a9eda6 Mon Sep 17 00:00:00 2001 From: RetroEdit <30182911+RetroEdit@users.noreply.github.com> Date: Tue, 7 Jul 2020 20:09:41 +0000 Subject: [PATCH] Simplify some DialogResult code. (#2213) --- .../config/AmstradCPC/AmstradCPCAudioSettings.cs | 10 ++-------- .../config/ZXSpectrum/ZXSpectrumAudioSettings.cs | 9 ++------- .../ZXSpectrum/ZXSpectrumCoreEmulationSettings.cs | 10 ++-------- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/config/AmstradCPC/AmstradCPCAudioSettings.cs b/src/BizHawk.Client.EmuHawk/config/AmstradCPC/AmstradCPCAudioSettings.cs index 87eb709fa3..bf89308939 100644 --- a/src/BizHawk.Client.EmuHawk/config/AmstradCPC/AmstradCPCAudioSettings.cs +++ b/src/BizHawk.Client.EmuHawk/config/AmstradCPC/AmstradCPCAudioSettings.cs @@ -52,15 +52,9 @@ namespace BizHawk.Client.EmuHawk _settings.AYVolume = ayVolumetrackBar.Value; _mainForm.PutCoreSettings(_settings); - - DialogResult = DialogResult.OK; - Close(); - } - else - { - DialogResult = DialogResult.OK; - Close(); } + DialogResult = DialogResult.OK; + Close(); } private void CancelBtn_Click(object sender, EventArgs e) diff --git a/src/BizHawk.Client.EmuHawk/config/ZXSpectrum/ZXSpectrumAudioSettings.cs b/src/BizHawk.Client.EmuHawk/config/ZXSpectrum/ZXSpectrumAudioSettings.cs index c5d1247afb..d2f104f74b 100644 --- a/src/BizHawk.Client.EmuHawk/config/ZXSpectrum/ZXSpectrumAudioSettings.cs +++ b/src/BizHawk.Client.EmuHawk/config/ZXSpectrum/ZXSpectrumAudioSettings.cs @@ -56,14 +56,9 @@ namespace BizHawk.Client.EmuHawk _settings.AYVolume = ayVolumetrackBar.Value; _mainForm.PutCoreSettings(_settings); - DialogResult = DialogResult.OK; - Close(); - } - else - { - DialogResult = DialogResult.OK; - Close(); } + DialogResult = DialogResult.OK; + Close(); } private void CancelBtn_Click(object sender, EventArgs e) diff --git a/src/BizHawk.Client.EmuHawk/config/ZXSpectrum/ZXSpectrumCoreEmulationSettings.cs b/src/BizHawk.Client.EmuHawk/config/ZXSpectrum/ZXSpectrumCoreEmulationSettings.cs index ad43b0753b..0808103799 100644 --- a/src/BizHawk.Client.EmuHawk/config/ZXSpectrum/ZXSpectrumCoreEmulationSettings.cs +++ b/src/BizHawk.Client.EmuHawk/config/ZXSpectrum/ZXSpectrumCoreEmulationSettings.cs @@ -62,15 +62,9 @@ namespace BizHawk.Client.EmuHawk _syncSettings.AutoLoadTape = autoLoadcheckBox1.Checked; _mainForm.PutCoreSyncSettings(_syncSettings); - - DialogResult = DialogResult.OK; - Close(); - } - else - { - DialogResult = DialogResult.OK; - Close(); } + DialogResult = DialogResult.OK; + Close(); } private void CancelBtn_Click(object sender, EventArgs e)