Share via


EventMappingSettingsCollection.Insert(Int32, EventMappingSettings) メソッド

定義

指定した EventMappingSettings オブジェクトを、コレクションの指定したインデックス位置に追加します。

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)

パラメーター

index
Int32

EventMappingSettings オブジェクトの、コレクション内での有効なインデックス。

eventMappingSettings
EventMappingSettings

コレクションに挿入する EventMappingSettings オブジェクト。

例外

追加する EventMappingSettings オブジェクトが既にコレクションに存在しているか、インデックスが無効か、またはコレクションが読み取り専用です。

Insert メソッドを使用するコード例を次に示します。 このコード例は、HealthMonitoringSection クラスのために提供されている大規模な例の一部です。

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

注釈

index パラメーターがコレクション内の項目の数と等しい場合、エントリはコレクションの末尾に追加されます。

適用対象

こちらもご覧ください