RuleSettingsCollection.IndexOf(String) Método

Definición

Busca el índice de un RuleSettings objeto de la colección con el nombre especificado.

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

Parámetros

name
String

Nombre de un RuleSettings objeto de la colección.

Devoluciones

Índice de un RuleSettings objeto de la colección con el nombre especificado.

Ejemplos

En el ejemplo de código siguiente se muestra cómo usar el IndexOf método . Este ejemplo de código forma parte de un ejemplo más grande proporcionado para la HealthMonitoringSection clase .

// Get the index of the 'All Errors Default' RuleSettings in the Rules collection property.
Console.WriteLine("EventMappings index for 'All Errors Default': {0}.",
    healthMonitoringSection.Rules.IndexOf("All Errors Default"));
' Get the index of the 'All Errors Default' RuleSettings in the Rules collection property.
Console.WriteLine("EventMappings index for 'All Errors Default': {0}.", _
    healthMonitoringSection.Rules.IndexOf("All Errors Default"))

Comentarios

Devuelve -1 si un RuleSettings objeto con el nombre especificado no está en la colección.

Se aplica a

Consulte también