Class ICollectionExtensions
Extension methods for ICollection<T>.
Inherited Members
Namespace: System.Collections.Generic
Assembly: BotBrain.Overmind.dll
Syntax
public static class ICollectionExtensions
Methods
View SourceAddRange<T>(ICollection<T>, IEnumerable<T>)
Adds an enumerable of items to the collection.
Declaration
public static void AddRange<T>(this ICollection<T> self, IEnumerable<T> items)
Parameters
Type | Name | Description |
---|---|---|
ICollection<T> | self | The collection being extended. |
IEnumerable<T> | items | The items to add. |
Type Parameters
Name | Description |
---|---|
T | The item type. |
ForEach<T>(ICollection<T>, Action<T>)
Performs the specified action on each element of the collection.
Declaration
public static void ForEach<T>(this ICollection<T> self, Action<T> action)
Parameters
Type | Name | Description |
---|---|---|
ICollection<T> | self | The collection being extended. |
Action<T> | action | The action to perform. |
Type Parameters
Name | Description |
---|---|
T | The item type. |
SetRange<T>(ICollection<T>, IEnumerable<T>)
Clears then adds an enumerable of items to the collection.
Declaration
public static void SetRange<T>(this ICollection<T> self, IEnumerable<T> items)
Parameters
Type | Name | Description |
---|---|---|
ICollection<T> | self | The collection being extended. |
IEnumerable<T> | items | The items to add. |
Type Parameters
Name | Description |
---|---|
T | The item type. |