diff --git a/ICD.Common.Utils/Collections/IcdHashSet.cs b/ICD.Common.Utils/Collections/IcdHashSet.cs index 8a9bab3..8f46f92 100644 --- a/ICD.Common.Utils/Collections/IcdHashSet.cs +++ b/ICD.Common.Utils/Collections/IcdHashSet.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using ICD.Common.Properties; +using ICD.Common.Utils.Extensions; namespace ICD.Common.Utils.Collections { @@ -328,6 +329,18 @@ namespace ICD.Common.Utils.Collections return m_Dict.Remove(item); } + /// + /// Removes each of the items in the sequence from the collection. + /// + /// + public void RemoveRange(IEnumerable items) + { + if (items == null) + throw new ArgumentNullException("items"); + + m_Dict.RemoveAll(items); + } + #endregion #region IEnumerable diff --git a/ICD.Common.Utils/Extensions/DictionaryExtensions.cs b/ICD.Common.Utils/Extensions/DictionaryExtensions.cs index 6db705a..9397b4c 100644 --- a/ICD.Common.Utils/Extensions/DictionaryExtensions.cs +++ b/ICD.Common.Utils/Extensions/DictionaryExtensions.cs @@ -19,6 +19,9 @@ namespace ICD.Common.Utils.Extensions if (extends == null) throw new ArgumentNullException("extends"); + if (keys == null) + throw new ArgumentNullException("keys"); + foreach (TKey key in keys) extends.Remove(key); }