Edit

Share via


TraceListenerCollection.Insert(Int32, TraceListener) Method

Definition

Inserts the listener at the specified index.

public:
 void Insert(int index, System::Diagnostics::TraceListener ^ listener);
public void Insert (int index, System.Diagnostics.TraceListener listener);
member this.Insert : int * System.Diagnostics.TraceListener -> unit
Public Sub Insert (index As Integer, listener As TraceListener)

Parameters

index
Int32

The position in the list to insert the new TraceListener.

listener
TraceListener

A TraceListener to insert in the list.

Exceptions

The index is not a valid index in the list.

listener is null.

Remarks

If the index equals the number of items in the list, then the listener is appended to the end of the list.

The index is zero-based. Therefore, if you want to insert the listener into the third position, you must call myTraceListenerColl.Insert(2, myNewListener).

Applies to

See also