CodeCommentStatementCollection Klasse
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Stellt eine Auflistung von CodeCommentStatement -Objekten dar.
public ref 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
[<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
- Vererbung
- Attribute
Beispiele
Im folgenden Beispiel wird die Verwendung der CodeCommentStatementCollection Klassenmethoden veranschaulicht. Das Beispiel erstellt eine neue Instanz der Klasse und verwendet die Methoden, um der Auflistung Anweisungen hinzuzufügen, ihren Index zurückzugeben und Attribute an einem bestimmten Indexpunkt hinzuzufügen oder daraus zu entfernen.
// 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)
Hinweise
Die CodeCommentStatementCollection Klasse stellt ein einfaches Auflistungsobjekt bereit, das zum Speichern einer Gruppe von CodeCommentStatement Objekten verwendet werden kann.
Konstruktoren
| Name | Beschreibung |
|---|---|
| CodeCommentStatementCollection() |
Initialisiert eine neue Instanz der CodeCommentStatementCollection-Klasse. |
| CodeCommentStatementCollection(CodeCommentStatement[]) |
Initialisiert eine neue Instanz der CodeCommentStatementCollection Klasse, die das angegebene Array von CodeCommentStatement Objekten enthält. |
| CodeCommentStatementCollection(CodeCommentStatementCollection) |
Initialisiert eine neue Instanz der CodeCommentStatementCollection Klasse, die die Elemente der angegebenen Quellauflistung enthält. |
Eigenschaften
| Name | Beschreibung |
|---|---|
| Capacity |
Ruft die Anzahl der Elemente ab, die dies enthalten kann, oder legt diese CollectionBase fest. (Geerbt von CollectionBase) |
| Count |
Ruft die Anzahl der In der CollectionBase Instanz enthaltenen Elemente ab. Diese Eigenschaft kann nicht außer Kraft gesetzt werden. (Geerbt von CollectionBase) |
| InnerList |
Ruft eine ArrayList liste der Elemente in der CollectionBase Instanz ab. (Geerbt von CollectionBase) |
| Item[Int32] |
Dient zum Abrufen oder Festlegen des CodeCommentStatement Objekts am angegebenen Index in der Auflistung. |
| List |
Ruft eine IList liste der Elemente in der CollectionBase Instanz ab. (Geerbt von CollectionBase) |
Methoden
| Name | Beschreibung |
|---|---|
| Add(CodeCommentStatement) |
Fügt das angegebene CodeCommentStatement Objekt der Auflistung hinzu. |
| AddRange(CodeCommentStatement[]) |
Kopiert die Elemente des angegebenen CodeCommentStatement Arrays an das Ende der Auflistung. |
| AddRange(CodeCommentStatementCollection) |
Kopiert den Inhalt eines anderen CodeCommentStatementCollection Objekts an das Ende der Auflistung. |
| Clear() |
Entfernt alle Objekte aus der CollectionBase Instanz. Diese Methode kann nicht überschrieben werden. (Geerbt von CollectionBase) |
| Contains(CodeCommentStatement) |
Ruft einen Wert ab, der angibt, ob die Auflistung das angegebene CodeCommentStatement Objekt enthält. |
| CopyTo(CodeCommentStatement[], Int32) |
Kopiert die Auflistungsobjekte an den angegebenen eindimensionalen Array Anfang am angegebenen Index. |
| Equals(Object) |
Bestimmt, ob das angegebene Objekt dem aktuellen Objekt entspricht. (Geerbt von Object) |
| GetEnumerator() |
Gibt einen Enumerator zurück, der die CollectionBase Instanz durchläuft. (Geerbt von CollectionBase) |
| GetHashCode() |
Dient als Standardhashfunktion. (Geerbt von Object) |
| GetType() |
Ruft die Type der aktuellen Instanz ab. (Geerbt von Object) |
| IndexOf(CodeCommentStatement) |
Ruft den Index des angegebenen CodeCommentStatement Objekts in der Auflistung ab, falls es in der Auflistung vorhanden ist. |
| Insert(Int32, CodeCommentStatement) |
Fügt ein CodeCommentStatement Objekt in die Auflistung am angegebenen Index ein. |
| MemberwiseClone() |
Erstellt eine flache Kopie der aktuellen Object. (Geerbt von Object) |
| OnClear() |
Führt zusätzliche benutzerdefinierte Prozesse aus, wenn der Inhalt der CollectionBase Instanz gelöscht wird. (Geerbt von CollectionBase) |
| OnClearComplete() |
Führt zusätzliche benutzerdefinierte Prozesse aus, nachdem der Inhalt der CollectionBase Instanz gelöscht wurde. (Geerbt von CollectionBase) |
| OnInsert(Int32, Object) |
Führt zusätzliche benutzerdefinierte Prozesse aus, bevor ein neues Element in die CollectionBase Instanz eingefügt wird. (Geerbt von CollectionBase) |
| OnInsertComplete(Int32, Object) |
Führt zusätzliche benutzerdefinierte Prozesse aus, nachdem ein neues Element in die CollectionBase Instanz eingefügt wurde. (Geerbt von CollectionBase) |
| OnRemove(Int32, Object) |
Führt zusätzliche benutzerdefinierte Prozesse aus, wenn ein Element aus der CollectionBase Instanz entfernt wird. (Geerbt von CollectionBase) |
| OnRemoveComplete(Int32, Object) |
Führt zusätzliche benutzerdefinierte Prozesse aus, nachdem ein Element aus der CollectionBase Instanz entfernt wurde. (Geerbt von CollectionBase) |
| OnSet(Int32, Object, Object) |
Führt zusätzliche benutzerdefinierte Prozesse aus, bevor ein Wert in der CollectionBase Instanz festgelegt wird. (Geerbt von CollectionBase) |
| OnSetComplete(Int32, Object, Object) |
Führt nach dem Festlegen eines Werts in der CollectionBase Instanz weitere benutzerdefinierte Prozesse aus. (Geerbt von CollectionBase) |
| OnValidate(Object) |
Führt beim Überprüfen eines Werts zusätzliche benutzerdefinierte Prozesse aus. (Geerbt von CollectionBase) |
| Remove(CodeCommentStatement) |
Entfernt das angegebene CodeCommentStatement Objekt aus der Auflistung. |
| RemoveAt(Int32) |
Entfernt das Element am angegebenen Index der CollectionBase Instanz. Diese Methode kann nicht außer Kraft gesetzt werden. (Geerbt von CollectionBase) |
| ToString() |
Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. (Geerbt von Object) |
Explizite Schnittstellenimplementierungen
| Name | Beschreibung |
|---|---|
| ICollection.CopyTo(Array, Int32) |
Kopiert das Gesamte CollectionBase in einen kompatiblen eindimensionalen Array, beginnend am angegebenen Index des Zielarrays. (Geerbt von CollectionBase) |
| ICollection.IsSynchronized |
Ruft einen Wert ab, der angibt, ob der Zugriff auf die CollectionBase synchronisiert wird (Threadsicher). (Geerbt von CollectionBase) |
| ICollection.SyncRoot |
Ruft ein Objekt ab, das zum Synchronisieren des Zugriffs auf die CollectionBaseverwendet werden kann. (Geerbt von CollectionBase) |
| IList.Add(Object) |
Fügt ein Objekt am Ende der .CollectionBase (Geerbt von CollectionBase) |
| IList.Contains(Object) |
Bestimmt, ob das CollectionBase Element ein bestimmtes Element enthält. (Geerbt von CollectionBase) |
| IList.IndexOf(Object) |
Sucht nach dem angegebenen Object Und gibt den nullbasierten Index des ersten Vorkommens innerhalb des gesamten CollectionBasezurück. (Geerbt von CollectionBase) |
| IList.Insert(Int32, Object) |
Fügt ein Element in den CollectionBase angegebenen Index ein. (Geerbt von CollectionBase) |
| IList.IsFixedSize |
Ruft einen Wert ab, der angibt, ob die CollectionBase Größe fest ist. (Geerbt von CollectionBase) |
| IList.IsReadOnly |
Ruft einen Wert ab, der angibt, ob die CollectionBase schreibgeschützt ist. (Geerbt von CollectionBase) |
| IList.Item[Int32] |
Ruft das Element am angegebenen Index ab oder legt es fest. (Geerbt von CollectionBase) |
| IList.Remove(Object) |
Entfernt das erste Vorkommen eines bestimmten Objekts aus dem CollectionBase. (Geerbt von CollectionBase) |
Erweiterungsmethoden
| Name | Beschreibung |
|---|---|
| AsParallel(IEnumerable) |
Aktiviert die Parallelisierung einer Abfrage. |
| AsQueryable(IEnumerable) |
Wandelt eine IEnumerable in eine IQueryableum. |
| Cast<TResult>(IEnumerable) |
Wandelt die Elemente eines IEnumerable in den angegebenen Typ um. |
| OfType<TResult>(IEnumerable) |
Filtert die Elemente einer IEnumerable basierend auf einem angegebenen Typ. |