CodeCommentStatementCollection 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
CodeCommentStatement 개체의 컬렉션을 나타냅니다.
public ref class CodeCommentStatementCollection : System::Collections::CollectionBase
public class CodeCommentStatementCollection : System.Collections.CollectionBase
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeCommentStatementCollection : System.Collections.CollectionBase
type CodeCommentStatementCollection = class
inherit CollectionBase
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeCommentStatementCollection = class
inherit CollectionBase
Public Class CodeCommentStatementCollection
Inherits CollectionBase
- 상속
- 특성
예제
다음 예제에서는 클래스 메서드의 CodeCommentStatementCollection 사용을 보여 줍니다. 이 예제에서는 클래스의 새 instance 만들고 메서드를 사용하여 컬렉션에 문을 추가하고, 인덱스를 반환하고, 특정 인덱스 지점에서 특성을 추가하거나 제거합니다.
// Creates an empty CodeCommentStatementCollection.
CodeCommentStatementCollection^ collection = gcnew CodeCommentStatementCollection;
// Adds a CodeCommentStatement to the collection.
collection->Add( gcnew CodeCommentStatement( "Test comment" ) );
// Adds an array of CodeCommentStatement objects to the collection.
array<CodeCommentStatement^>^comments = {gcnew CodeCommentStatement( "Test comment" ),gcnew CodeCommentStatement( "Another test comment" )};
collection->AddRange( comments );
// Adds a collection of CodeCommentStatement objects to the collection.
CodeCommentStatementCollection^ commentsCollection = gcnew CodeCommentStatementCollection;
commentsCollection->Add( gcnew CodeCommentStatement( "Test comment" ) );
commentsCollection->Add( gcnew CodeCommentStatement( "Another test comment" ) );
collection->AddRange( commentsCollection );
// Tests for the presence of a CodeCommentStatement in the
// collection, and retrieves its index if it is found.
CodeCommentStatement^ testComment = gcnew CodeCommentStatement( "Test comment" );
int itemIndex = -1;
if ( collection->Contains( testComment ) )
itemIndex = collection->IndexOf( testComment );
// Copies the contents of the collection, beginning at index 0,
// to the specified CodeCommentStatement array.
// 'comments' is a CodeCommentStatement array.
collection->CopyTo( comments, 0 );
// Retrieves the count of the items in the collection.
int collectionCount = collection->Count;
// Inserts a CodeCommentStatement at index 0 of the collection.
collection->Insert( 0, gcnew CodeCommentStatement( "Test comment" ) );
// Removes the specified CodeCommentStatement from the collection.
CodeCommentStatement^ comment = gcnew CodeCommentStatement( "Test comment" );
collection->Remove( comment );
// Removes the CodeCommentStatement at index 0.
collection->RemoveAt( 0 );
// Creates an empty CodeCommentStatementCollection.
CodeCommentStatementCollection collection = new CodeCommentStatementCollection();
// Adds a CodeCommentStatement to the collection.
collection.Add( new CodeCommentStatement("Test comment") );
// Adds an array of CodeCommentStatement objects to the collection.
CodeCommentStatement[] comments = { new CodeCommentStatement("Test comment"), new CodeCommentStatement("Another test comment") };
collection.AddRange( comments );
// Adds a collection of CodeCommentStatement objects to the collection.
CodeCommentStatementCollection commentsCollection = new CodeCommentStatementCollection();
commentsCollection.Add( new CodeCommentStatement("Test comment") );
commentsCollection.Add( new CodeCommentStatement("Another test comment") );
collection.AddRange( commentsCollection );
// Tests for the presence of a CodeCommentStatement in the
// collection, and retrieves its index if it is found.
CodeCommentStatement testComment = new CodeCommentStatement("Test comment");
int itemIndex = -1;
if( collection.Contains( testComment ) )
itemIndex = collection.IndexOf( testComment );
// Copies the contents of the collection, beginning at index 0,
// to the specified CodeCommentStatement array.
// 'comments' is a CodeCommentStatement array.
collection.CopyTo( comments, 0 );
// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;
// Inserts a CodeCommentStatement at index 0 of the collection.
collection.Insert( 0, new CodeCommentStatement("Test comment") );
// Removes the specified CodeCommentStatement from the collection.
CodeCommentStatement comment = new CodeCommentStatement("Test comment");
collection.Remove( comment );
// Removes the CodeCommentStatement at index 0.
collection.RemoveAt(0);
' Creates an empty CodeCommentStatementCollection.
Dim collection As New CodeCommentStatementCollection()
' Adds a CodeCommentStatement to the collection.
collection.Add(New CodeCommentStatement("Test comment"))
' Adds an array of CodeCommentStatement objects to the collection.
Dim comments As CodeCommentStatement() = {New CodeCommentStatement("Test comment"), New CodeCommentStatement("Another test comment")}
collection.AddRange(comments)
' Adds a collection of CodeCommentStatement objects to the
' collection.
Dim commentsCollection As New CodeCommentStatementCollection()
commentsCollection.Add(New CodeCommentStatement("Test comment"))
commentsCollection.Add(New CodeCommentStatement("Another test comment"))
collection.AddRange(commentsCollection)
' Tests for the presence of a CodeCommentStatement in the
' collection, and retrieves its index if it is found.
Dim testComment As New CodeCommentStatement("Test comment")
Dim itemIndex As Integer = -1
If collection.Contains(testComment) Then
itemIndex = collection.IndexOf(testComment)
End If
' Copies the contents of the collection beginning at index 0 to the specified CodeCommentStatement array.
' 'comments' is a CodeCommentStatement array.
collection.CopyTo(comments, 0)
' Retrieves the count of the items in the collection.
Dim collectionCount As Integer = collection.Count
' Inserts a CodeCommentStatement at index 0 of the collection.
collection.Insert(0, New CodeCommentStatement("Test comment"))
' Removes the specified CodeCommentStatement from the collection.
Dim comment As New CodeCommentStatement("Test comment")
collection.Remove(comment)
' Removes the CodeCommentStatement at index 0.
collection.RemoveAt(0)
설명
클래스는 CodeCommentStatementCollection 개체 집합 CodeCommentStatement 을 저장하는 데 사용할 수 있는 간단한 컬렉션 개체를 제공합니다.
생성자
CodeCommentStatementCollection() |
CodeCommentStatementCollection 클래스의 새 인스턴스를 초기화합니다. |
CodeCommentStatementCollection(CodeCommentStatement[]) |
CodeCommentStatementCollection 개체의 지정된 배열을 포함하는 CodeCommentStatement 클래스의 새 인스턴스를 초기화합니다. |
CodeCommentStatementCollection(CodeCommentStatementCollection) |
지정된 소스 컬렉션의 요소를 포함하는 CodeCommentStatementCollection 클래스의 새 인스턴스를 초기화합니다. |
속성
Capacity |
CollectionBase에 포함될 수 있는 요소의 수를 가져오거나 설정합니다. (다음에서 상속됨 CollectionBase) |
Count |
CollectionBase 인스턴스에 포함된 요소 수를 가져옵니다. 이 속성은 재정의할 수 없습니다. (다음에서 상속됨 CollectionBase) |
InnerList |
ArrayList 인스턴스의 요소 목록을 포함하는 CollectionBase를 가져옵니다. (다음에서 상속됨 CollectionBase) |
Item[Int32] |
컬렉션의 지정된 인덱스에 있는 CodeCommentStatement 개체를 가져오거나 설정합니다. |
List |
IList 인스턴스의 요소 목록을 포함하는 CollectionBase를 가져옵니다. (다음에서 상속됨 CollectionBase) |
메서드
명시적 인터페이스 구현
확장 메서드
Cast<TResult>(IEnumerable) |
IEnumerable의 요소를 지정된 형식으로 캐스팅합니다. |
OfType<TResult>(IEnumerable) |
지정된 형식에 따라 IEnumerable의 요소를 필터링합니다. |
AsParallel(IEnumerable) |
쿼리를 병렬화할 수 있도록 합니다. |
AsQueryable(IEnumerable) |
IEnumerable을 IQueryable로 변환합니다. |
적용 대상
추가 정보
.NET