public static void Set() { PowerSNOID = Skills.Buffs(); HashSet <int> Values = new HashSet <int>(Items.Keys.Except(PowerSNOID.Keys).Concat(PowerSNOID.Keys.Except(Items.Keys))); foreach (int Key in Values) // Both delete and add keys { if (Items.ContainsKey(Key)) // Delete { Delete(Key); } else // Add new { Add(Key, PowerSNOID.Single(x => x.Key == Key).Value); } } // ## Update Extensions.Execute.UIThread(() => { foreach (KeyValuePair <int, Helpers> Key in Items) { Key.Value.Text.Text = Skills.Format(PowerSNOID.Single(x => x.Key == Key.Key).Value); } }); }