Foley .NET Utilities Class Library

SetBase.Contains Method (ICollection)

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

[Visual Basic]
Overridable Overloads Public Function Contains( _
   ByVal collection As ICollection _
) As Boolean Implements _
   ISet.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 set.

Return Value

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

Implements

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

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