TraceListenerCollection::Insert Method (Int32, TraceListener^)
.NET Framework (current version)
Inserts the listener at the specified index.
Assembly: System (in System.dll)
Parameters
- index
-
Type:
System::Int32
The position in the list to insert the new TraceListener.
- listener
-
Type:
System.Diagnostics::TraceListener^
A TraceListener to insert in the list.
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | The index is not a valid index in the list. |
| ArgumentException | listener is null. |
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).
.NET Framework
Available since 1.1
Available since 1.1
Show: