RuleSettingsCollection.Insert(Int32, RuleSettings) 메서드

정의

지정된 개체를 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"))

설명

인덱스 매개 변수가 컬렉션의 항목 수와 같으면 컬렉션의 끝에 항목이 추가됩니다.

적용 대상

추가 정보