RuleSettingsCollection.IndexOf(String) Método

Definição

Encontra o índice de um RuleSettings objeto na coleção com o nome 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

O nome de um RuleSettings objeto na coleção.

Devoluções

O índice de um RuleSettings objeto na coleção com o nome especificado.

Exemplos

O exemplo de código a seguir mostra como usar o IndexOf método. Este exemplo de código faz parte de um exemplo maior fornecido para a HealthMonitoringSection classe.

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

Observações

Devolve -1 se um RuleSettings objeto com o nome especificado não estiver na coleção.

Aplica-se a

Ver também