다음을 통해 공유


IList.Insert 메서드

항목을 IList의 지정된 인덱스에 삽입합니다.

네임스페이스: System.Collections
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Sub Insert ( _
    index As Integer, _
    value As Object _
)
‘사용 방법
Dim instance As IList
Dim index As Integer
Dim value As Object

instance.Insert(index, value)
void Insert (
    int index,
    Object value
)
void Insert (
    int index, 
    Object^ value
)
void Insert (
    int index, 
    Object value
)
function Insert (
    index : int, 
    value : Object
)

매개 변수

  • index
    0부터 시작하는 인덱스이며 value를 삽입해야 합니다.

예외

예외 형식 조건

ArgumentOutOfRangeException

index가 IList의 유효한 인덱스가 아닌 경우

NotSupportedException

IList가 읽기 전용인 경우

- 또는 -

IList의 크기가 고정되어 있는 경우

NullReferenceException

value가 IList에서 null 참조인 경우

설명

index가 IList의 항목 수와 같으면 value는 끝에 추가됩니다.

목록과 같은 연속 요소 컬렉션에서 삽입 지점 다음에 오는 요소는 새 요소를 수용할 수 있도록 아래로 이동합니다. 컬렉션이 인덱싱되면 이동되는 요소의 인덱스도 업데이트됩니다. 이 동작은 개념적으로 요소가 해시 테이블과 같은 버킷으로 그룹화되는 컬렉션에는 적용되지 않습니다.

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

IList 인터페이스
IList 멤버
System.Collections 네임스페이스