From e25b8bb2986c4f7e81d88a78eb822653f0e1b5e4 Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Sat, 28 Jan 2017 16:56:05 +0300 Subject: [PATCH] Removed explicit methods --- osu.Game/Configuration/OsuConfigManager.cs | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 2ff663e3a2..74a5cae051 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -169,20 +169,18 @@ namespace osu.Game.Configuration Set(OsuConfig.ConfineMouse, Get(OsuConfig.ConfineMouseToFullscreen) ? ConfineMouseMode.Fullscreen : ConfineMouseMode.Never); - GetBindable(OsuConfig.SavePassword).ValueChanged += delegate { eventPassword(); }; - GetBindable(OsuConfig.SaveUsername).ValueChanged += delegate { eventUsername(); }; -#pragma warning restore CS0612 // Type or member is obsolete - } - private void eventPassword() - { - if ((GetBindable(OsuConfig.SavePassword) == true) && (GetBindable(OsuConfig.SaveUsername) == false)) - Set(OsuConfig.SaveUsername, true); - } - private void eventUsername() - { - if ((GetBindable(OsuConfig.SaveUsername) == false) && (GetBindable(OsuConfig.SavePassword) == true)) - Set(OsuConfig.SavePassword, false); + GetBindable(OsuConfig.SavePassword).ValueChanged += delegate + { + if (Get(OsuConfig.SavePassword) && !Get(OsuConfig.SaveUsername)) + Set(OsuConfig.SaveUsername, true); + }; + GetBindable(OsuConfig.SaveUsername).ValueChanged += delegate + { + if (!Get(OsuConfig.SaveUsername) && Get(OsuConfig.SavePassword)) + Set(OsuConfig.SavePassword, false); + }; +#pragma warning restore CS0612 // Type or member is obsolete } //todo: make a UnicodeString class/struct rather than requiring this helper method.