ArcFM Server Developer Guide
RemoveFromList<T> Method


The type of elements to pass to the predicate for evaluation.
The list of elements.
The Predicate delegate that determines if an element is to be removed.
Removes all elements from a list that match the conditions specified by a given predicate. This method is thread-safe and should only be used with non-generic lists such as an System.Collections.ArrayList. For a generic list, use the RemoveAll method since it does not suffer from type-checking performance overhead.
Syntax
'Declaration
 
Public Shared Function RemoveFromList(Of T)( _
   ByVal list As IList, _
   ByVal match As Predicate(Of T) _
) As Integer
'Usage
 
Dim list As IList
Dim match As Predicate(Of T)
Dim value As Integer
 
value = Utilities.RemoveFromList(Of T)(list, match)
public static int RemoveFromList<T>( 
   IList list,
   Predicate<T> match
)

Parameters

list
The list of elements.
match
The Predicate delegate that determines if an element is to be removed.

Type Parameters

T
The type of elements to pass to the predicate for evaluation.

Return Value

The number of elements removed.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionThrown if list or match is null.
Remarks
This algorithm performs well on lists of all size, performing O(n).
Requirements

Target Platforms: Windows XP SP3 (32-bit and 64-bit), Windows 7 (32-bit and 64-bit)

Not all Operating Systems are supported on all products. Visit the ArcFM Solution Supported Versions page for full details.

See Also

Reference

Utilities Class
Utilities Members

 

 


Send Comment