private static bool DidDefaultSettingsChange(HotkeySettings[] defaultSettings, HotkeySettings[] loadedSettings) { if (defaultSettings == null || loadedSettings == null) return true; if (defaultSettings.Length != loadedSettings.Length) return true; var defaultCmds = defaultSettings.SelectMany(s => s.Commands).ToArray(); var loadedCmds = loadedSettings.SelectMany(s => s.Commands).ToArray(); if (defaultCmds.Length != loadedCmds.Length) return true; // TODO Add additional checks return false; }
internal static bool DidDefaultSettingsChange(HotkeySettings[] defaultSettings, HotkeySettings[] loadedSettings) { if (defaultSettings == null || loadedSettings == null) return true; if (defaultSettings.Length != loadedSettings.Length) return true; var defaultCmds = defaultSettings.SelectMany(s => s.Commands).ToArray(); var loadedCmds = loadedSettings.SelectMany(s => s.Commands).ToArray(); // see if total commands count has changed if (defaultCmds.Length != loadedCmds.Length) return true; // detect if total commands count did not change but a command was moved from one set to another for (int i = 0; i < defaultSettings.Length; i++) { var defaultSetting = defaultSettings[i]; var loadedSetting = loadedSettings[i]; if (defaultSetting.Commands.Length != loadedSetting.Commands.Length) { return true; } } return false; }