Sdílet prostřednictvím


EventMappingSettingsCollection.IndexOf(String) Metoda

Definice

Vrátí index zadaného EventMappingSettings objektu.

public:
 int IndexOf(System::String ^ name);
public int IndexOf (string name);
member this.IndexOf : string -> int
Public Function IndexOf (name As String) As Integer

Parametry

name
String

Název EventMappingSettings objektu v kolekci.

Návraty

Int32

Index zadaného EventMappingSettings objektu nebo -1, pokud objekt nebyl v kolekci nalezen.

Příklady

Následující příklad kódu ukazuje, jak použít metodu IndexOf . Tento příklad kódu je součástí většího příkladu zadaného HealthMonitoringSection pro třídu.

// Get the index of the 'HeartBeats' event in the EventMappings collection property.
Console.WriteLine("EventMappings index for 'HeartBeats': {0}.",
    healthMonitoringSection.EventMappings.IndexOf("HeartBeats"));
' Get the index of the 'HeartBeats' event in the EventMappings collection property.
Console.WriteLine("EventMappings index for 'HeartBeats': {0}.", _
    healthMonitoringSection.EventMappings.IndexOf("HeartBeats"))

Platí pro

Viz také