Show / Hide Table of Contents

Class ICollectionExtensions

Extension methods for ICollection<T>.

Inheritance
object
ICollectionExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: System.Collections.Generic
Assembly: BotBrain.Overmind.dll
Syntax
public static class ICollectionExtensions

Methods

View Source

AddRange<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.

View Source

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.

View Source

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.

  • View Source
In this article
Back to top Generated by DocFX