다음을 통해 공유


EventMappingSettingsCollection.IndexOf(String) 메서드

정의

지정된 EventMappingSettings 개체의 인덱스를 반환합니다.

public:
 int IndexOf(System::String ^ name);
public int IndexOf (string name);
member this.IndexOf : string -> int
Public Function IndexOf (name As String) As Integer

매개 변수

name
String

컬렉션에 있는 EventMappingSettings 개체의 이름입니다.

반환

Int32

지정된 EventMappingSettings 개체의 인덱스이거나, 컬렉션에 개체가 없으면 -1입니다.

예제

다음 코드 예제에서는 IndexOf 메서드를 사용하는 방법을 보여 줍니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 HealthMonitoringSection 클래스입니다.

// Get the index of the 'HeartBeats' event in the EventMappings collection property.
Console.WriteLine("EventMappings index for 'HeartBeats': {0}.",
    healthMonitoringSection.EventMappings.IndexOf("HeartBeats"));
' Get the index of the 'HeartBeats' event in the EventMappings collection property.
Console.WriteLine("EventMappings index for 'HeartBeats': {0}.", _
    healthMonitoringSection.EventMappings.IndexOf("HeartBeats"))

적용 대상

추가 정보