EventMappingSettingsCollection.Insert(Int32, EventMappingSettings) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将指定的 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))
注解
如果索引参数等于集合中的项数,则条目将追加到集合的末尾。