CodeStatementCollection 클래스

정의

CodeStatement 개체의 컬렉션을 나타냅니다.

public ref class CodeStatementCollection : System::Collections::CollectionBase
public class CodeStatementCollection : System.Collections.CollectionBase
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeStatementCollection : System.Collections.CollectionBase
type CodeStatementCollection = class
    inherit CollectionBase
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeStatementCollection = class
    inherit CollectionBase
Public Class CodeStatementCollection
Inherits CollectionBase
상속
CodeStatementCollection
특성

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다는 CodeStatementCollection 클래스입니다. 이 예제에서는 클래스의 새 instance 만들고 여러 메서드를 사용하여 컬렉션에 문을 추가하고, 인덱스를 반환하고, 특정 인덱스 지점에서 문을 추가하거나 제거합니다.

// Creates an empty CodeStatementCollection.
CodeStatementCollection^ collection = gcnew CodeStatementCollection;

// Adds a CodeStatement to the collection.
collection->Add( gcnew CodeCommentStatement( "Test comment statement" ) );

// Adds an array of CodeStatement objects to the collection.
array<CodeStatement^>^statements = {gcnew CodeCommentStatement( "Test comment statement" ),gcnew CodeCommentStatement( "Test comment statement" )};
collection->AddRange( statements );

// Adds a collection of CodeStatement objects to the collection.
CodeStatement^ testStatement = gcnew CodeCommentStatement( "Test comment statement" );
CodeStatementCollection^ statementsCollection = gcnew CodeStatementCollection;
statementsCollection->Add( gcnew CodeCommentStatement( "Test comment statement" ) );
statementsCollection->Add( gcnew CodeCommentStatement( "Test comment statement" ) );
statementsCollection->Add( testStatement );
collection->AddRange( statementsCollection );

// Tests for the presence of a CodeStatement in the 
// collection, and retrieves its index if it is found.
int itemIndex = -1;
if ( collection->Contains( testStatement ) )
   itemIndex = collection->IndexOf( testStatement );

// Copies the contents of the collection beginning at index 0 to the specified CodeStatement array.
// 'statements' is a CodeStatement array.
collection->CopyTo( statements, 0 );

// Retrieves the count of the items in the collection.
int collectionCount = collection->Count;

// Inserts a CodeStatement at index 0 of the collection.
collection->Insert( 0, gcnew CodeCommentStatement( "Test comment statement" ) );

// Removes the specified CodeStatement from the collection.
collection->Remove( testStatement );

// Removes the CodeStatement at index 0.
collection->RemoveAt( 0 );
// Creates an empty CodeStatementCollection.
CodeStatementCollection collection = new CodeStatementCollection();

// Adds a CodeStatement to the collection.
collection.Add( new CodeCommentStatement("Test comment statement") );

// Adds an array of CodeStatement objects to the collection.
CodeStatement[] statements = {
                new CodeCommentStatement("Test comment statement"),
                new CodeCommentStatement("Test comment statement")};
collection.AddRange( statements );

// Adds a collection of CodeStatement objects to the collection.
CodeStatement testStatement = new CodeCommentStatement("Test comment statement");
CodeStatementCollection statementsCollection = new CodeStatementCollection();
statementsCollection.Add( new CodeCommentStatement("Test comment statement") );
statementsCollection.Add( new CodeCommentStatement("Test comment statement") );
statementsCollection.Add( testStatement );

collection.AddRange( statementsCollection );

// Tests for the presence of a CodeStatement in the
// collection, and retrieves its index if it is found.
int itemIndex = -1;
if( collection.Contains( testStatement ) )
    itemIndex = collection.IndexOf( testStatement );


// Copies the contents of the collection beginning at index 0 to the specified CodeStatement array.
// 'statements' is a CodeStatement array.
CodeStatement[] statementArray = new CodeStatement[collection.Count];
collection.CopyTo( statementArray, 0 );

// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;

// Inserts a CodeStatement at index 0 of the collection.
collection.Insert( 0, new CodeCommentStatement("Test comment statement") );

// Removes the specified CodeStatement from the collection.
collection.Remove( testStatement );

// Removes the CodeStatement at index 0.
collection.RemoveAt(0);
' Creates an empty CodeStatementCollection.
Dim collection As New CodeStatementCollection

' Adds a CodeStatement to the collection.
collection.Add(New CodeCommentStatement("Test comment statement"))

' Adds an array of CodeStatement objects to the collection.
Dim statements As CodeStatement() = {New CodeCommentStatement("Test comment statement"), New CodeCommentStatement("Test comment statement")}
collection.AddRange(statements)

' Adds a collection of CodeStatement objects to the collection.
Dim testStatement As New CodeStatement
Dim statementsCollection As New CodeStatementCollection
statementsCollection.Add(New CodeCommentStatement("Test comment statement"))
statementsCollection.Add(New CodeCommentStatement("Test comment statement"))
statementsCollection.Add(testStatement)
collection.AddRange(statementsCollection)

' Tests for the presence of a CodeStatement in the 
' collection, and retrieves its index if it is found.
Dim itemIndex As Integer = -1
If collection.Contains(testStatement) Then
    itemIndex = collection.IndexOf(testStatement)
End If

' Copies the contents of the collection beginning at index 0 to the specified CodeStatement array.
' 'statements' is a CodeStatement array.
Dim statementArray(collection.Count - 1) As CodeStatement
collection.CopyTo(statementArray, 0)

' Retrieves the count of the items in the collection.
Dim collectionCount As Integer = collection.Count

' Inserts a CodeStatement at index 0 of the collection.
collection.Insert(0, New CodeCommentStatement("Test comment statement"))

' Removes the specified CodeStatement from the collection.
collection.Remove(testStatement)

' Removes the CodeStatement at index 0.
collection.RemoveAt(0)

설명

클래스는 CodeStatementCollection 개체 집합 CodeStatement 을 저장하는 데 사용할 수 있는 간단한 컬렉션 개체를 제공합니다.

생성자

CodeStatementCollection()

CodeStatementCollection 클래스의 새 인스턴스를 초기화합니다.

CodeStatementCollection(CodeStatement[])

지정된 CodeStatementCollection 개체 배열이 들어 있는 CodeStatement 클래스의 새 인스턴스를 초기화합니다.

CodeStatementCollection(CodeStatementCollection)

지정된 소스 컬렉션의 요소가 들어 있는 CodeStatementCollection 클래스의 새 인스턴스를 초기화합니다.

속성

Capacity

CollectionBase에 포함될 수 있는 요소의 수를 가져오거나 설정합니다.

(다음에서 상속됨 CollectionBase)
Count

CollectionBase 인스턴스에 포함된 요소 수를 가져옵니다. 이 속성은 재정의할 수 없습니다.

(다음에서 상속됨 CollectionBase)
InnerList

ArrayList 인스턴스의 요소 목록을 포함하는 CollectionBase를 가져옵니다.

(다음에서 상속됨 CollectionBase)
Item[Int32]

컬렉션의 지정된 인덱스에 있는 CodeStatement 개체를 가져오거나 설정합니다.

List

IList 인스턴스의 요소 목록을 포함하는 CollectionBase를 가져옵니다.

(다음에서 상속됨 CollectionBase)

메서드

Add(CodeExpression)

지정된 CodeExpression 개체를 컬렉션에 추가합니다.

Add(CodeStatement)

지정된 CodeStatement 개체를 컬렉션에 추가합니다.

AddRange(CodeStatement[])

CodeStatement 개체 집합을 컬렉션에 추가합니다.

AddRange(CodeStatementCollection)

다른 CodeStatementCollection 개체의 내용을 컬렉션 끝에 추가합니다.

Clear()

CollectionBase 인스턴스에서 개체를 모두 제거합니다. 이 메서드는 재정의할 수 없습니다.

(다음에서 상속됨 CollectionBase)
Contains(CodeStatement)

컬렉션에 지정된 CodeStatement 개체가 들어 있는지 여부를 나타내는 값을 가져옵니다.

CopyTo(CodeStatement[], Int32)

CodeStatementCollection 개체의 요소를 지정된 인덱스에서 시작하여 1차원 Array에 복사합니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetEnumerator()

CollectionBase 인스턴스를 반복하는 열거자를 반환합니다.

(다음에서 상속됨 CollectionBase)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
IndexOf(CodeStatement)

CodeStatement에 지정된 CodeStatementCollection 개체가 있는 경우 해당 인덱스를 가져옵니다.

Insert(Int32, CodeStatement)

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

MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
OnClear()

CollectionBase 인스턴스의 콘텐츠를 지운 후에 추가로 사용자 지정 프로세스를 수행합니다.

(다음에서 상속됨 CollectionBase)
OnClearComplete()

CollectionBase 인스턴스의 내용을 지운 후에 추가로 사용자 지정 프로세스를 수행합니다.

(다음에서 상속됨 CollectionBase)
OnInsert(Int32, Object)

CollectionBase 인스턴스에 새 요소를 삽입하기 전에 추가로 사용자 지정 프로세스를 수행합니다.

(다음에서 상속됨 CollectionBase)
OnInsertComplete(Int32, Object)

CollectionBase 인스턴스에 새 요소를 삽입한 후에 추가로 사용자 지정 프로세스를 수행합니다.

(다음에서 상속됨 CollectionBase)
OnRemove(Int32, Object)

CollectionBase 인스턴스에서 요소를 제거할 때 추가로 사용자 지정 프로세스를 수행합니다.

(다음에서 상속됨 CollectionBase)
OnRemoveComplete(Int32, Object)

CollectionBase 인스턴스에서 요소를 제거한 후에 추가로 사용자 지정 프로세스를 수행합니다.

(다음에서 상속됨 CollectionBase)
OnSet(Int32, Object, Object)

CollectionBase 인스턴스에 값을 설정하기 전에 추가로 사용자 지정 프로세스를 수행합니다.

(다음에서 상속됨 CollectionBase)
OnSetComplete(Int32, Object, Object)

CollectionBase 인스턴스에 값을 설정한 후에 추가로 사용자 지정 프로세스를 수행합니다.

(다음에서 상속됨 CollectionBase)
OnValidate(Object)

값의 유효성을 검사할 때 추가로 사용자 지정 프로세스를 수행합니다.

(다음에서 상속됨 CollectionBase)
Remove(CodeStatement)

컬렉션에서 지정된 CodeStatement 개체를 제거합니다.

RemoveAt(Int32)

CollectionBase 인스턴스의 지정한 인덱스에서 요소를 제거합니다. 이 메서드는 재정의할 수 없습니다.

(다음에서 상속됨 CollectionBase)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

ICollection.CopyTo(Array, Int32)

대상 배열의 지정된 인덱스에서 시작하여 전체 CollectionBase을 호환되는 1차원 Array에 복사합니다.

(다음에서 상속됨 CollectionBase)
ICollection.IsSynchronized

CollectionBase에 대한 액세스가 동기화되어 스레드로부터 안전하게 보호되는지를 나타내는 값을 가져옵니다.

(다음에서 상속됨 CollectionBase)
ICollection.SyncRoot

CollectionBase에 대한 액세스를 동기화하는 데 사용할 수 있는 개체를 가져옵니다.

(다음에서 상속됨 CollectionBase)
IList.Add(Object)

개체를 CollectionBase의 끝 부분에 추가합니다.

(다음에서 상속됨 CollectionBase)
IList.Contains(Object)

CollectionBase에 특정 요소가 들어 있는지 여부를 확인합니다.

(다음에서 상속됨 CollectionBase)
IList.IndexOf(Object)

지정한 Object를 검색하고, 전체 CollectionBase 내에서 처음 나오는 0부터 시작하는 인덱스를 반환합니다.

(다음에서 상속됨 CollectionBase)
IList.Insert(Int32, Object)

CollectionBase의 지정된 인덱스에 요소를 삽입합니다.

(다음에서 상속됨 CollectionBase)
IList.IsFixedSize

CollectionBase의 크기가 고정되어 있는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 CollectionBase)
IList.IsReadOnly

CollectionBase가 읽기 전용인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 CollectionBase)
IList.Item[Int32]

지정한 인덱스에 있는 요소를 가져오거나 설정합니다.

(다음에서 상속됨 CollectionBase)
IList.Remove(Object)

CollectionBase에서 맨 처음 발견되는 특정 개체를 제거합니다.

(다음에서 상속됨 CollectionBase)

확장 메서드

Cast<TResult>(IEnumerable)

IEnumerable의 요소를 지정된 형식으로 캐스팅합니다.

OfType<TResult>(IEnumerable)

지정된 형식에 따라 IEnumerable의 요소를 필터링합니다.

AsParallel(IEnumerable)

쿼리를 병렬화할 수 있도록 합니다.

AsQueryable(IEnumerable)

IEnumerableIQueryable로 변환합니다.

적용 대상

추가 정보