CodeCommentStatementCollection Třída

Definice

Představuje kolekci CodeCommentStatement objektů.

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
Dědičnost
CodeCommentStatementCollection
Atributy

Příklady

Následující příklad ukazuje použití CodeCommentStatementCollection metod třídy. Příklad vytvoří novou instanci třídy a pomocí metod přidá příkazy do kolekce, vrátí jejich index a přidá nebo odebere atributy v určitém bodu indexu.

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

Poznámky

Třída CodeCommentStatementCollection poskytuje jednoduchý objekt kolekce, který lze použít k uložení sady CodeCommentStatement objektů.

Konstruktory

Name Description
CodeCommentStatementCollection()

Inicializuje novou instanci CodeCommentStatementCollection třídy.

CodeCommentStatementCollection(CodeCommentStatement[])

Inicializuje novou instanci CodeCommentStatementCollection třídy obsahující zadané pole CodeCommentStatement objektů.

CodeCommentStatementCollection(CodeCommentStatementCollection)

Inicializuje novou instanci CodeCommentStatementCollection třídy obsahující prvky zadané zdrojové kolekce.

Vlastnosti

Name Description
Capacity

Získá nebo nastaví počet prvků, které CollectionBase může obsahovat.

(Zděděno od CollectionBase)
Count

Získá počet prvků obsažených CollectionBase v instanci. Tuto vlastnost nelze přepsat.

(Zděděno od CollectionBase)
InnerList

ArrayList Získá obsahující seznam prvků v CollectionBase instanci.

(Zděděno od CollectionBase)
Item[Int32]

Získá nebo nastaví CodeCommentStatement objekt v zadaném indexu v kolekci.

List

IList Získá obsahující seznam prvků v CollectionBase instanci.

(Zděděno od CollectionBase)

Metody

Name Description
Add(CodeCommentStatement)

Přidá zadaný CodeCommentStatement objekt do kolekce.

AddRange(CodeCommentStatement[])

Zkopíruje prvky zadaného CodeCommentStatement pole na konec kolekce.

AddRange(CodeCommentStatementCollection)

Zkopíruje obsah jiného CodeCommentStatementCollection objektu na konec kolekce.

Clear()

Odebere všechny objekty z CollectionBase instance. Tuto metodu nelze přepsat.

(Zděděno od CollectionBase)
Contains(CodeCommentStatement)

Získá hodnotu, která určuje, zda kolekce obsahuje zadaný CodeCommentStatement objekt.

CopyTo(CodeCommentStatement[], Int32)

Zkopíruje objekty kolekce na zadaný jednorozměrný Array začátek zadaného indexu.

Equals(Object)

Určuje, zda je zadaný objekt roven aktuálnímu objektu.

(Zděděno od Object)
GetEnumerator()

Vrátí enumerátor, který iteruje prostřednictvím CollectionBase instance.

(Zděděno od CollectionBase)
GetHashCode()

Slouží jako výchozí funkce hash.

(Zděděno od Object)
GetType()

Získá Type aktuální instance.

(Zděděno od Object)
IndexOf(CodeCommentStatement)

Získá index zadaného CodeCommentStatement objektu v kolekci, pokud existuje v kolekci.

Insert(Int32, CodeCommentStatement)

Vloží CodeCommentStatement objekt do kolekce v zadaném indexu.

MemberwiseClone()

Vytvoří mělkou kopii aktuálního Object.

(Zděděno od Object)
OnClear()

Provádí další vlastní procesy při vymazání obsahu CollectionBase instance.

(Zděděno od CollectionBase)
OnClearComplete()

Provádí další vlastní procesy po vymazání obsahu CollectionBase instance.

(Zděděno od CollectionBase)
OnInsert(Int32, Object)

Provádí další vlastní procesy před vložením nového prvku do CollectionBase instance.

(Zděděno od CollectionBase)
OnInsertComplete(Int32, Object)

Provede další vlastní procesy po vložení nového prvku do CollectionBase instance.

(Zděděno od CollectionBase)
OnRemove(Int32, Object)

Provádí další vlastní procesy při odebírání elementu CollectionBase z instance.

(Zděděno od CollectionBase)
OnRemoveComplete(Int32, Object)

Provádí další vlastní procesy po odebrání elementu CollectionBase z instance.

(Zděděno od CollectionBase)
OnSet(Int32, Object, Object)

Před nastavením hodnoty v CollectionBase instanci provede další vlastní procesy.

(Zděděno od CollectionBase)
OnSetComplete(Int32, Object, Object)

Provede další vlastní procesy po nastavení hodnoty v CollectionBase instanci.

(Zděděno od CollectionBase)
OnValidate(Object)

Provádí další vlastní procesy při ověřování hodnoty.

(Zděděno od CollectionBase)
Remove(CodeCommentStatement)

Odebere zadaný CodeCommentStatement objekt z kolekce.

RemoveAt(Int32)

Odebere prvek v zadaném indexu CollectionBase instance. Tato metoda není přepsatelná.

(Zděděno od CollectionBase)
ToString()

Vrátí řetězec, který představuje aktuální objekt.

(Zděděno od Object)

Explicitní implementace rozhraní

Name Description
ICollection.CopyTo(Array, Int32)

Zkopíruje celý CollectionBase soubor do kompatibilního jednorozměrného Array, počínaje zadaným indexem cílového pole.

(Zděděno od CollectionBase)
ICollection.IsSynchronized

Získá hodnotu označující, zda je přístup k CollectionBase této synchronizaci (bezpečné vlákno).

(Zděděno od CollectionBase)
ICollection.SyncRoot

Získá objekt, který lze použít k synchronizaci přístupu k CollectionBase.

(Zděděno od CollectionBase)
IList.Add(Object)

Přidá objekt na konec objektu CollectionBase.

(Zděděno od CollectionBase)
IList.Contains(Object)

Určuje, zda obsahuje CollectionBase určitý prvek.

(Zděděno od CollectionBase)
IList.IndexOf(Object)

Vyhledá zadaný Object index a vrátí index založený na nule prvního výskytu v celém CollectionBaserozsahu .

(Zděděno od CollectionBase)
IList.Insert(Int32, Object)

Vloží prvek do zadaného indexu CollectionBase .

(Zděděno od CollectionBase)
IList.IsFixedSize

Získá hodnotu určující, zda CollectionBase má pevnou velikost.

(Zděděno od CollectionBase)
IList.IsReadOnly

Získá hodnotu určující, zda je jen pro CollectionBase čtení.

(Zděděno od CollectionBase)
IList.Item[Int32]

Získá nebo nastaví prvek v zadaném indexu.

(Zděděno od CollectionBase)
IList.Remove(Object)

Odebere první výskyt konkrétního objektu z objektu CollectionBase.

(Zděděno od CollectionBase)

Metody rozšíření

Name Description
AsParallel(IEnumerable)

Umožňuje paralelizaci dotazu.

AsQueryable(IEnumerable)

Převede IEnumerable na IQueryable.

Cast<TResult>(IEnumerable)

Přetypuje prvky IEnumerable na zadaný typ.

OfType<TResult>(IEnumerable)

Filtruje prvky IEnumerable na základě zadaného typu.

Platí pro

Viz také