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

Adds an item to 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 void Add(
	T item
)
Visual Basic
Public Overridable Sub Add ( _
	item As T _
)
Visual C++
public:
virtual void Add(
	T item
)
F#
abstract Add : 
        item:'T -> unit 
override Add : 
        item:'T -> unit 
JScript
public function Add(
	item : T
)

Parameters

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

Implements

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

Remarks

Note for inheritors: Call OnAdding(ListWithEvents<(Of <<'(T>)>>)..::..CancelableItemIndexEventArgs) before adding an item to the list and OnAdded(ListWithEvents<(Of <<'(T>)>>)..::..ItemIndexEventArgs) after adding item to the list, 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 Adding event -or- Any excption may be thrown by OnAdding(ICollection, Nullable<(Of <<'(Int32>)>>), Boolean) when AllowItemCancel is true.

See Also