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

적용 대상