RuleSettingsCollection.Insert(Int32, RuleSettings) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将指定的 RuleSettings 对象添加到集合中的指定索引点。
public:
void Insert(int index, System::Web::Configuration::RuleSettings ^ eventSettings);
public void Insert(int index, System.Web.Configuration.RuleSettings eventSettings);
member this.Insert : int * System.Web.Configuration.RuleSettings -> unit
Public Sub Insert (index As Integer, eventSettings As RuleSettings)
参数
- index
- Int32
集合中对象的有效索引 RuleSettings 。
- eventSettings
- RuleSettings
要 RuleSettings 插入到集合中的对象。
例外
要 RuleSettings 添加的对象已存在于集合中,索引无效,或集合为只读。
示例
下面的代码示例演示如何使用 Insert 该方法。 该代码示例是 HealthMonitoringSection 类中的一个较大示例的一部分。
// Insert an RuleSettings object into the Rules collection property.
healthMonitoringSection.Rules.Insert(1,
new RuleSettings("All Errors Default2",
"All Errors", "EventLogProvider"));
' Insert an RuleSettings object into the Rules collection property.
healthMonitoringSection.Rules.Insert(1, _
new RuleSettings("All Errors Default2", _
"All Errors", "EventLogProvider"))
注解
如果索引参数等于集合中的项数,则条目将追加到集合的末尾。