EventMappingSettingsCollection.Contains Method (String)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Indicates whether the collection contains an EventMappingSettings object with the specified name.

Namespace:   System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

public bool Contains(
	string name
)

Parameters

name
Type: System.String

The name of an EventMappingSettings object in the collection.

Return Value

Type: System.Boolean

true if the collection contains an EventMappingSettings object with the specified name; otherwise, false.

This method returns false if the specified name does not exist.

The following code example shows how to use the Contains method. This code example is part of a larger example provided for the HealthMonitoringSection class.

// See if the EventMappings collection property contains the event 'HeartBeats'.
Console.WriteLine("EventMappings contains 'HeartBeats': {0}.",
    healthMonitoringSection.EventMappings.Contains("HeartBeats"));

.NET Framework
Available since 2.0
Return to top
Show: