CodeDirectiveCollection.Insert(Int32, CodeDirective) 메서드

정의

지정된 CodeDirective 개체를 컬렉션의 지정된 인덱스에 삽입합니다.

public:
 void Insert(int index, System::CodeDom::CodeDirective ^ value);
public void Insert (int index, System.CodeDom.CodeDirective value);
member this.Insert : int * System.CodeDom.CodeDirective -> unit
Public Sub Insert (index As Integer, value As CodeDirective)

매개 변수

index
Int32

지정된 개체를 삽입해야 하는 인덱스 위치(0부터 시작)입니다.

value
CodeDirective

삽입할 CodeDirective 개체입니다.

예외

index 가 0보다 작습니다.

또는

indexCount보다 큰 경우

예제

다음 코드 예제에서는 메서드를 사용하여 컬렉션의 Insert 인덱스 0에 개체를 CodeDirective 삽입하는 방법을 보여줍니다. 이 예제는에 대해 제공 된 큰 예제의 일부는 CodeDirectiveCollection 클래스입니다.

// Inserts a CodeDirective at index 0 of the collection.
collection.Insert(0, new CodeRegionDirective(CodeRegionMode.Start, "Region1"));
' Inserts a CodeDirective at index 0 of the collection.
collection.Insert(0, New CodeRegionDirective(CodeRegionMode.Start, "Region1"))

적용 대상