Foley .NET Utilities Class Library

List2Base.Contains Method (ICollection)

Determines whether all the elements in the specified ICollection are contained in the list.

[Visual Basic]
Overridable Overloads Public Function Contains( _
   ByVal collection As ICollection _
) As Boolean Implements _
   IList2.Contains
[C#]
public virtual bool Contains(
   ICollection collection
);

Parameters

collection
The ICollection whose elements are to be checked if all of its elements are contained in the list.

Return Value

true if all the elements of the ICollection are found in the list; otherwise, false.

Implements

IList2.Contains

Remarks

This method determines equality by calling Equals. Keep in mind that the Object to locate can be a null reference (Nothing in Visual Basic). If you do not want this behaviour you must override this method.

Exceptions

Exception TypeCondition
System.NullReferenceException The collection is a null reference (Nothing in Visual Basic).

See Also

List2Base Class | List2Base Members | Foley.Utilities.Collections Namespace | List2Base.Contains Overload List