/// <summary> /// Insert missing pad settings and clean-up the list. /// </summary> /// <param name="list"></param> public void UpsertPadSettings(params PadSetting[] list) { foreach (var item in list) { // If pad setting was not found then... if (!PadSettings.Items.Any(x => x.PadSettingChecksum == item.PadSettingChecksum)) { // Add pad setting. PadSettings.Add(item); } } }
/// <summary> /// Insert missing pad settings and cleanup the list. /// </summary> /// <param name="list"></param> public void UpsertPadSettings(params PadSetting[] list) { foreach (var item in list) { var old = PadSettings.Items.FirstOrDefault(x => x.PadSettingChecksum == item.PadSettingChecksum); if (old == null) { PadSettings.Add(item); } } CleanupPadSettings(); }