CodeAttributeDeclarationCollection Klasse

Definition

Stellt eine Auflistung von CodeAttributeDeclaration -Objekten dar.

public ref class CodeAttributeDeclarationCollection : System::Collections::CollectionBase
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeAttributeDeclarationCollection : System.Collections.CollectionBase
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeAttributeDeclarationCollection = class
    inherit CollectionBase
Public Class CodeAttributeDeclarationCollection
Inherits CollectionBase
Vererbung
CodeAttributeDeclarationCollection
Attribute

Beispiele

Im folgenden Beispiel wird die Verwendung der CodeAttributeDeclarationCollection Klassenmethoden veranschaulicht.

// Creates an empty CodeAttributeDeclarationCollection.
CodeAttributeDeclarationCollection collection = new CodeAttributeDeclarationCollection();

// Adds a CodeAttributeDeclaration to the collection.
collection.Add( new CodeAttributeDeclaration("DescriptionAttribute",  new CodeAttributeArgument(new CodePrimitiveExpression("Test Description"))) );

// Adds an array of CodeAttributeDeclaration objects
// to the collection.
CodeAttributeDeclaration[] declarations = { new CodeAttributeDeclaration(), new CodeAttributeDeclaration() };
collection.AddRange( declarations );

// Adds a collection of CodeAttributeDeclaration objects
// to the collection.
CodeAttributeDeclarationCollection declarationsCollection = new CodeAttributeDeclarationCollection();
declarationsCollection.Add( new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description"))) );
declarationsCollection.Add( new CodeAttributeDeclaration("BrowsableAttribute", new CodeAttributeArgument(new CodePrimitiveExpression(true))) );
collection.AddRange( declarationsCollection );

// Tests for the presence of a CodeAttributeDeclaration in
// the collection, and retrieves its index if it is found.
CodeAttributeDeclaration testdeclaration = new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description")) );
int itemIndex = -1;
if( collection.Contains( testdeclaration ) )
    itemIndex = collection.IndexOf( testdeclaration );

// Copies the contents of the collection, beginning at index 0,
// to the specified CodeAttributeDeclaration array.
// 'declarations' is a CodeAttributeDeclaration array.
collection.CopyTo( declarations, 0 );

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

// Inserts a CodeAttributeDeclaration at index 0 of the collection.
collection.Insert( 0, new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description"))) );

// Removes the specified CodeAttributeDeclaration from
// the collection.
CodeAttributeDeclaration declaration = new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description")) );
collection.Remove( declaration );

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

' Adds a CodeAttributeDeclaration to the collection.
collection.Add(New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description"))))

' Adds an array of CodeAttributeDeclaration objects to the collection.
Dim declarations As CodeAttributeDeclaration() = {New CodeAttributeDeclaration(), New CodeAttributeDeclaration()}
collection.AddRange(declarations)

' Adds a collection of CodeAttributeDeclaration objects to 
' the collection.
Dim declarationsCollection As New CodeAttributeDeclarationCollection()
declarationsCollection.Add(New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description"))))
declarationsCollection.Add(New CodeAttributeDeclaration("BrowsableAttribute", New CodeAttributeArgument(New CodePrimitiveExpression(True))))
collection.AddRange(declarationsCollection)

' Tests for the presence of a CodeAttributeDeclaration in the 
' collection, and retrieves its index if it is found.
Dim testdeclaration As New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description")))
Dim itemIndex As Integer = -1
If collection.Contains(testdeclaration) Then
    itemIndex = collection.IndexOf(testdeclaration)
End If

' Copies the contents of the collection beginning at index 0 to the specified CodeAttributeDeclaration array.
' 'declarations' is a CodeAttributeDeclaration array.
collection.CopyTo(declarations, 0)

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

' Inserts a CodeAttributeDeclaration at index 0 of the collection.
collection.Insert(0, New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description"))))

' Removes the specified CodeAttributeDeclaration from the collection.
Dim declaration As New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description")))
collection.Remove(declaration)

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

Hinweise

Die CodeAttributeDeclarationCollection Klasse stellt ein einfaches Auflistungsobjekt bereit, das zum Speichern einer Gruppe von CodeAttributeDeclaration Objekten verwendet werden kann.

Konstruktoren

Name Beschreibung
CodeAttributeDeclarationCollection()

Initialisiert eine neue Instanz der CodeAttributeDeclarationCollection-Klasse.

CodeAttributeDeclarationCollection(CodeAttributeDeclaration[])

Initialisiert eine neue Instanz der CodeAttributeDeclarationCollection Klasse, die das angegebene Array von CodeAttributeDeclaration Objekten enthält.

CodeAttributeDeclarationCollection(CodeAttributeDeclarationCollection)

Initialisiert eine neue Instanz der CodeAttributeDeclarationCollection 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]

Ruft ab oder legt das CodeAttributeDeclaration Objekt am angegebenen Index fest.

List

Ruft eine IList liste der Elemente in der CollectionBase Instanz ab.

(Geerbt von CollectionBase)

Methoden

Name Beschreibung
Add(CodeAttributeDeclaration)

Fügt der Auflistung ein CodeAttributeDeclaration Objekt mit dem angegebenen Wert hinzu.

AddRange(CodeAttributeDeclaration[])

Kopiert die Elemente des angegebenen CodeAttributeDeclaration Arrays an das Ende der Auflistung.

AddRange(CodeAttributeDeclarationCollection)

Kopiert den Inhalt eines anderen CodeAttributeDeclarationCollection Objekts an das Ende der Auflistung.

Clear()

Entfernt alle Objekte aus der CollectionBase Instanz. Diese Methode kann nicht überschrieben werden.

(Geerbt von CollectionBase)
Contains(CodeAttributeDeclaration)

Dient zum Abrufen oder Festlegen eines Werts, der angibt, ob die Auflistung das angegebene CodeAttributeDeclaration Objekt enthält.

CopyTo(CodeAttributeDeclaration[], Int32)

Kopiert die Auflistungsobjekte in eine eindimensionale Array Instanz, die am angegebenen Index beginnt.

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(CodeAttributeDeclaration)

Ruft den Index des angegebenen CodeAttributeDeclaration Objekts in der Auflistung ab, falls es in der Auflistung vorhanden ist.

Insert(Int32, CodeAttributeDeclaration)

Fügt das angegebene CodeAttributeDeclaration 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(CodeAttributeDeclaration)

Entfernt das angegebene CodeAttributeDeclaration 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.

Gilt für:

Weitere Informationen