편집

다음을 통해 공유


EventMappingSettingsCollection.Insert(Int32, EventMappingSettings) Method

Definition

Adds the specified EventMappingSettings object to the specified index point in the collection.

public:
 void Insert(int index, System::Web::Configuration::EventMappingSettings ^ eventMappingSettings);
public void Insert (int index, System.Web.Configuration.EventMappingSettings eventMappingSettings);
member this.Insert : int * System.Web.Configuration.EventMappingSettings -> unit
Public Sub Insert (index As Integer, eventMappingSettings As EventMappingSettings)

Parameters

index
Int32

A valid index of an EventMappingSettings object in the collection.

eventMappingSettings
EventMappingSettings

The EventMappingSettings object to insert into the collection.

Exceptions

The EventMappingSettings object to add already exists in the collection, the index is invalid, or the collection is read-only.

Examples

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

// Insert an EventMappingsSettings object into the EventMappings collection property.
healthMonitoringSection.EventMappings.Insert(1, 
    new EventMappingSettings("HeartBeats", "", 1, 2));
' Insert an EventMappingsSettings object into the EventMappings collection property.
healthMonitoringSection.EventMappings.Insert(1, _
    new EventMappingSettings("HeartBeats", "", 1, 2))

Remarks

If the index parameter equals the number of items in the collection, then the entry is appended to the end of the collection.

Applies to

See also