Edit

Share via


TraceListenerCollection.Item[] Property

Definition

Gets or sets the specified TraceListener.

Overloads

Item[Int32]

Gets or sets the TraceListener at the specified index.

Item[String]

Gets the first TraceListener in the list with the specified name.

Item[Int32]

Source:
TraceListeners.cs
Source:
TraceListeners.cs
Source:
TraceListeners.cs

Gets or sets the TraceListener at the specified index.

public:
 property System::Diagnostics::TraceListener ^ default[int] { System::Diagnostics::TraceListener ^ get(int i); void set(int i, System::Diagnostics::TraceListener ^ value); };
public System.Diagnostics.TraceListener this[int i] { get; set; }
member this.Item(int) : System.Diagnostics.TraceListener with get, set
Default Public Property Item(i As Integer) As TraceListener

Parameters

i
Int32

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

Property Value

A TraceListener with the specified index.

Exceptions

The value is null.

Remarks

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].

See also

Applies to

Item[String]

Source:
TraceListeners.cs
Source:
TraceListeners.cs
Source:
TraceListeners.cs

Gets the first TraceListener in the list with the specified name.

public:
 property System::Diagnostics::TraceListener ^ default[System::String ^] { System::Diagnostics::TraceListener ^ get(System::String ^ name); };
public System.Diagnostics.TraceListener? this[string name] { get; }
public System.Diagnostics.TraceListener this[string name] { get; }
member this.Item(string) : System.Diagnostics.TraceListener
Default Public ReadOnly Property Item(name As String) As TraceListener

Parameters

name
String

The name of the TraceListener to get from the list.

Property Value

The first TraceListener in the list with the given Name. This item returns null if no TraceListener with the given name can be found.

Remarks

The Item[] property is case-sensitive when searching for names. That is, if two listeners exist with the names "Lname" and "lname", Item[] property will find only the TraceListener with the Name that you specify, not both.

See also

Applies to