Langue

RuleSettingsCollection.Contains(String) Méthode

Définition

Retourne true si la collection contient un RuleSettings objet portant le nom spécifié.

public:
 bool Contains(System::String ^ name);
public bool Contains(string name);
member this.Contains : string -> bool
Public Function Contains (name As String) As Boolean

Paramètres

name
String

Nom d’un RuleSettings objet dans la collection.

Retours

true si la collection contient un RuleSettings objet portant le nom spécifié ; sinon, false.

Exemples

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

// See if the Rules collection property contains the RuleSettings 'All Errors Default'.
Console.WriteLine("EventMappings contains 'All Errors Default': {0}.",
    healthMonitoringSection.Rules.Contains("All Errors Default"));
' See if the Rules collection property contains the RuleSettings 'All Errors Default'.
Console.WriteLine("EventMappings contains 'All Errors Default': {0}.", _
    healthMonitoringSection.Rules.Contains("All Errors Default"))

Remarques

Retourne false si le nom spécifié n’existe pas.

S’applique à

Voir aussi