Table of Contents

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

set ISet<T>

The set to set the item in.

item T

The item to set.

value bool

The 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

T

The 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

set ISet<T>

The set to toggle the item in.

item T

The item to toggle.

Returns

bool

True if the item was added, false if it was removed.

Type Parameters

T

The type of the items in the set.