EventMappingSettingsCollection.Contains(String) Method

Definition

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

C#
public bool Contains(string name);

Parameters

name
String

The name of an EventMappingSettings object in the collection.

Returns

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

Examples

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.

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

Remarks

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

Applies to

Tuote Versiot
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also