Muokkaa

Jaa


EventMappingSettingsCollection.IndexOf(String) Method

Definition

Returns the index of the specified EventMappingSettings object.

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

Parameters

name
String

The name of an EventMappingSettings object in the collection.

Returns

The index of the specified EventMappingSettings object, or -1 if the object is not found in the collection.

Examples

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

// 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"))

Applies to

See also