Sdílet prostřednictvím


ProfileSettingsCollection.Contains(String) Metoda

Definice

Určuje, zda kolekce obsahuje ProfileSettings objekt se zadaným názvem.

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

Parametry

name
String

Název ProfileSettings objektu v kolekci.

Návraty

Boolean

true pokud kolekce obsahuje ProfileSettings objekt se zadaným name; v opačném případě false.

Příklady

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

// See if the ProfileSettings collection property contains the event 'Default'.
Console.WriteLine("Profiles contains 'Default': {0}.",
    healthMonitoringSection.Profiles.Contains("Default"));
' See if the ProfileSettings collection property contains the event 'Default'.
Console.WriteLine("Profiles contains 'Default': {0}.", _
    healthMonitoringSection.Profiles.Contains("Default"))

Platí pro

Viz také