EventMappingSettingsCollection.Contains(String) EventMappingSettingsCollection.Contains(String) EventMappingSettingsCollection.Contains(String) EventMappingSettingsCollection.Contains(String) Method

定義

指定した名前の EventMappingSettings オブジェクトがコレクション内に存在するかどうかを示します。Indicates whether the collection contains an EventMappingSettings object with the specified name.

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

パラメーター

name
String String String String

コレクション内の EventMappingSettings オブジェクトの名前。The name of an EventMappingSettings object in the collection.

戻り値

指定した名前の EventMappingSettings オブジェクトがコレクションに格納されている場合は true。それ以外の場合は falsetrue if the collection contains an EventMappingSettings object with the specified name; otherwise, false.

Contains メソッドを使用するコード例を次に示します。The following code example shows how to use the Contains method. このコード例が示されている例の一部、HealthMonitoringSectionクラス。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"));
' See if the EventMappings collection property contains the event 'HeartBeats'.
Console.WriteLine("EventMappings contains 'HeartBeats': {0}.", _
    healthMonitoringSection.EventMappings.Contains("HeartBeats"))

注釈

このメソッドが戻るfalse指定した名前が存在しない場合。This method returns false if the specified name does not exist.

適用対象

こちらもご覧ください