[This is preliminary documentation and is subject to change.]

Removes the first occurrence of a specific object from the ListWithEvents<(Of <(<'T>)>)>.

Namespace: Tools.CollectionsT.GenericT
Assembly: Tools (in Tools.dll) Version: 1.5.3.38916 (1.5.3.38916)

Syntax

C#
public virtual bool Remove(
	T item
)
Visual Basic
Public Overridable Function Remove ( _
	item As T _
) As Boolean
Visual C++
public:
virtual bool Remove(
	T item
)
F#
abstract Remove : 
        item:'T -> bool 
override Remove : 
        item:'T -> bool 
JScript
public function Remove(
	item : T
) : boolean

Parameters

item
Type: T
The object to remove from the ListWithEvents<(Of <(<'T>)>)>.

Return Value

true if item was successfully removed from the ListWithEvents<(Of <(<'T>)>)>; otherwise, false. This method also returns false if item is not found in the original ListWithEvents<(Of <(<'T>)>)>.

Implements

ICollection<(Of <(<'T>)>)>..::..Remove(T)

Remarks

Note for inheritors: Call OnRemoving(ListWithEvents<(Of <<'(T>)>>)..::..CancelableItemIndexEventArgs) before removing item and OnRemoved(ListWithEvents<(Of <<'(T>)>>)..::..ItemIndexEventArgs) after removing item, do not forgot to check Cancel

Exceptions

ExceptionCondition
System..::..InvalidOperationExceptionLocked is True
System..::..OperationCanceledExceptionOperation is canceled in eventhandler and CancelError is true
System..::..ExceptionAny Exception can be thrown by event handler of the Removing event -or- Any excption may be thrown by OnRemoving(ICollection, Nullable<(Of <<'(Int32>)>>)) when AllowItemCancel is true.

See Also