Class ISetExtensions
- Namespace
- Olve.Utilities.CollectionExtensions
- Assembly
- Olve.Utilities.dll
Extension methods for ISet<T>.
public static class ISetExtensions
- Inheritance
-
ISetExtensions
- Inherited Members
Methods
Set<T>(ISet<T>, T, bool)
Sets the item in the set. If the value is true, the item is added. If the value is false, the item is removed.
public static bool Set<T>(this ISet<T> set, T item, bool value)
Parameters
setISet<T>The set to set the item in.
itemTThe item to set.
valueboolThe value to set the item to.
Returns
- bool
True if the item was added or removed from the set, false if nothing changed.
Type Parameters
TThe type of the items in the set.
Toggle<T>(ISet<T>, T)
Toggles the item in the set. If the item is not in the set, it is added. If the item is in the set, it is removed.
public static bool Toggle<T>(this ISet<T> set, T item)
Parameters
setISet<T>The set to toggle the item in.
itemTThe item to toggle.
Returns
- bool
True if the item was added, false if it was removed.
Type Parameters
TThe type of the items in the set.