TraceListenerCollection::Item Property (Int32)


Gets or sets the TraceListener at the specified index.

Namespace:   System.Diagnostics
Assembly:  System (in System.dll)

property TraceListener^ default[
	int i
] {
	TraceListener^ get(int i);
	void set(int i, TraceListener^ value);


Type: System::Int32

The zero-based index of the TraceListener to get from the list.

Property Value

Type: System.Diagnostics::TraceListener^

A TraceListener with the specified index.

Exception Condition

The value is null.

The index is zero-based. Therefore, you must subtract one from the numerical position of a particular TraceListener to access that TraceListener. For example, to get the third TraceListener, you need to specify myTraceListenerColl[2].

.NET Framework
Available since 1.1
Return to top