Langue

EventMappingSettingsCollection.IndexOf(String) Méthode

Définition

Retourne l’index de l’objet spécifié EventMappingSettings .

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

Paramètres

name
String

Nom d’un EventMappingSettings objet dans la collection.

Retours

Index de l’objet spécifié EventMappingSettings ou -1 si l’objet est introuvable dans la collection.

Exemples

L’exemple de code suivant montre comment utiliser la IndexOf méthode. Cet exemple de code fait partie d’un exemple plus grand fourni pour la HealthMonitoringSection classe.

// 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"))

S’applique à

Voir aussi