C# Class Open.Core.Helpers.CollectionHelper

Utility methods for working with collections.
Afficher le fichier Open project: philcockfield/Open.TestHarness.SL

Méthodes publiques

Méthode Description
Count ( IEnumerable collection ) : int

Gets the total number of items within the given collection.

DisposeAndClear ( ArrayList collection ) : void

Clears the collection, disposing of all disposable children.

Filter ( IEnumerable collection, FuncBool predicate ) : ArrayList

Constructs a subset of the collection based on the response of an include-filter.

First ( IEnumerable collection, FuncBool predicate ) : object

Retrieves the first item that matches the given filter (or null if there is no match).

Last ( IEnumerable collection ) : object

Retrieves the last item in the given collection (or null if there are no items).

ToArrayList ( IEnumerable collection ) : ArrayList

Converts an enumerable to an ArrayList.

Total ( IEnumerable collection, FuncBool predicate ) : int

Gets the total number of items that match the given predicate.

Method Details

Count() public méthode

Gets the total number of items within the given collection.
public Count ( IEnumerable collection ) : int
collection IEnumerable The collection to count.
Résultat int

DisposeAndClear() public méthode

Clears the collection, disposing of all disposable children.
public DisposeAndClear ( ArrayList collection ) : void
collection System.Collections.ArrayList The collection to clear and dispose.
Résultat void

Filter() public méthode

Constructs a subset of the collection based on the response of an include-filter.
public Filter ( IEnumerable collection, FuncBool predicate ) : ArrayList
collection IEnumerable The collection to filter.
predicate FuncBool The predicate to match.
Résultat System.Collections.ArrayList

First() public méthode

Retrieves the first item that matches the given filter (or null if there is no match).
public First ( IEnumerable collection, FuncBool predicate ) : object
collection IEnumerable The collection to examine.
predicate FuncBool The predicate to match.
Résultat object

Last() public méthode

Retrieves the last item in the given collection (or null if there are no items).
public Last ( IEnumerable collection ) : object
collection IEnumerable The collection to examine.
Résultat object

ToArrayList() public méthode

Converts an enumerable to an ArrayList.
public ToArrayList ( IEnumerable collection ) : ArrayList
collection IEnumerable The collection to convert.
Résultat System.Collections.ArrayList

Total() public méthode

Gets the total number of items that match the given predicate.
public Total ( IEnumerable collection, FuncBool predicate ) : int
collection IEnumerable The collection to examine.
predicate FuncBool The predicate to match.
Résultat int