Table of Contents

Class Collection<T>

Namespace
Dynamicweb.Content.Items
Assembly
Dynamicweb.dll

Represents a collection of elements.

public class Collection<T> : Collection<T>, IList<T>, ICollection<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable

Type Parameters

T

Element type.

Inheritance
Collection<T>
Implements
Derived
Inherited Members
Extension Methods

Constructors

Collection()

Initializes a new instance of an object.

public Collection()

Collection(IEnumerable<T>)

Initializes a new instance of an object.

public Collection(IEnumerable<T> items)

Parameters

items IEnumerable<T>

Elements to be copied to this collection.

Properties

Data

Gets the underlying data storage.

protected List<T> Data { get; }

Property Value

List<T>

Methods

AddRange(IEnumerable<T>)

Adds a given elements to the end of the collection.

public void AddRange(IEnumerable<T> items)

Parameters

items IEnumerable<T>

Elements to add.

Find(Func<T, bool>)

Returns a first element from the collection that satisfies the condition.

public T Find(Func<T, bool> predicate)

Parameters

predicate Func<T, bool>

Condition.

Returns

T

A first element from the collection that satisfies the condition.

FindAll(Func<T, bool>)

Returns all elements from the collection that satisfies the condition.

public IEnumerable<T> FindAll(Func<T, bool> predicate)

Parameters

predicate Func<T, bool>

Condition.

Returns

IEnumerable<T>

All elements from the collection that satisfies the condition.

FindIndex(Func<T, bool>)

Returns an index of a first element from the collection that satisfies the condition.

public int FindIndex(Func<T, bool> predicate)

Parameters

predicate Func<T, bool>

Condition.

Returns

int

An index of a first element from the collection that satisfies the condition.

RemoveRange(IEnumerable<T>)

Removes a given elements from the collection.

public void RemoveRange(IEnumerable<T> items)

Parameters

items IEnumerable<T>

Elements to remove.

Sort(IComparer<T>)

Sorts elements according to the given comparer.

public void Sort(IComparer<T> comparer)

Parameters

comparer IComparer<T>

Comparer.

Sort(Comparison<T>)

Sorts elements according to the given comparison.

public void Sort(Comparison<T> comparison)

Parameters

comparison Comparison<T>

Comparison.

To top