CodeTypeReferenceCollection Klasse

Definition

Stellt eine Auflistung von CodeTypeReference-Objekten dar.

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

Beispiele

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

// Adds a CodeTypeReference to the collection.
collection->Add( gcnew CodeTypeReference( bool::typeid ) );

// Adds an array of CodeTypeReference objects to the collection.
array<CodeTypeReference^>^references = {gcnew CodeTypeReference( bool::typeid ),gcnew CodeTypeReference( bool::typeid )};
collection->AddRange( references );

// Adds a collection of CodeTypeReference objects to the collection.
CodeTypeReferenceCollection^ referencesCollection = gcnew CodeTypeReferenceCollection;
referencesCollection->Add( gcnew CodeTypeReference( bool::typeid ) );
referencesCollection->Add( gcnew CodeTypeReference( bool::typeid ) );
collection->AddRange( referencesCollection );

// Tests for the presence of a CodeTypeReference in the 
// collection, and retrieves its index if it is found.
CodeTypeReference^ testReference = gcnew CodeTypeReference( bool::typeid );
int itemIndex = -1;
if ( collection->Contains( testReference ) )
   itemIndex = collection->IndexOf( testReference );

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

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

// Inserts a CodeTypeReference at index 0 of the collection.
collection->Insert( 0, gcnew CodeTypeReference( bool::typeid ) );

// Removes the specified CodeTypeReference from the collection.
CodeTypeReference^ reference = gcnew CodeTypeReference( bool::typeid );
collection->Remove( reference );

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

// Adds a CodeTypeReference to the collection.
collection.Add( new CodeTypeReference(typeof(bool)) );

// Adds an array of CodeTypeReference objects to the collection.
CodeTypeReference[] references = { new CodeTypeReference(typeof(bool)), new CodeTypeReference(typeof(bool)) };
collection.AddRange( references );

// Adds a collection of CodeTypeReference objects to the collection.
CodeTypeReferenceCollection referencesCollection = new CodeTypeReferenceCollection();
referencesCollection.Add( new CodeTypeReference(typeof(bool)) );
referencesCollection.Add( new CodeTypeReference(typeof(bool)) );
collection.AddRange( referencesCollection );

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

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

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

// Inserts a CodeTypeReference at index 0 of the collection.
collection.Insert( 0, new CodeTypeReference(typeof(bool)) );

// Removes the specified CodeTypeReference from the collection.
CodeTypeReference reference = new CodeTypeReference(typeof(bool));
collection.Remove( reference );

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

' Adds a CodeTypeReference to the collection.
collection.Add(New CodeTypeReference(GetType(Boolean)))

' Adds an array of CodeTypeReference objects to the collection.
Dim references As CodeTypeReference() = {New CodeTypeReference(GetType(Boolean)), New CodeTypeReference(GetType(Boolean))}
collection.AddRange(references)

' Adds a collection of CodeTypeReference objects to the collection.
Dim referencesCollection As New CodeTypeReferenceCollection()
referencesCollection.Add(New CodeTypeReference(GetType(Boolean)))
referencesCollection.Add(New CodeTypeReference(GetType(Boolean)))
collection.AddRange(referencesCollection)

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

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

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

' Inserts a CodeTypeReference at index 0 of the collection.
collection.Insert(0, New CodeTypeReference(GetType(Boolean)))

' Removes the specified CodeTypeReference from the collection.
Dim reference As New CodeTypeReference(GetType(Boolean))
collection.Remove(reference)

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

Hinweise

Die CodeTypeReferenceCollection-Klasse stellt ein einfaches Auflistungsobjekt bereit, mit dem ein Satz von CodeTypeReference-Objekten gespeichert werden kann.

Konstruktoren

CodeTypeReferenceCollection()

Initialisiert eine neue Instanz der CodeTypeReferenceCollection-Klasse.

CodeTypeReferenceCollection(CodeTypeReference[])

Initialisiert eine neue Instanz der CodeTypeReferenceCollection-Klasse, die das angegebene Array von CodeTypeReference-Objekten enthält.

CodeTypeReferenceCollection(CodeTypeReferenceCollection)

Initialisiert eine neue Instanz der CodeTypeReferenceCollection-Klasse, die die Elemente der angegebenen Quellauflistung enthält.

Eigenschaften

Capacity

Ruft die Anzahl der Elemente ab, die die CollectionBase enthalten kann, oder legt diese fest.

(Geerbt von CollectionBase)
Count

Ruft die Anzahl der in der CollectionBase-Instanz enthaltenen Elemente ab. Diese Eigenschaft kann nicht überschrieben werden.

(Geerbt von CollectionBase)
InnerList

Ruft eine ArrayList mit der Liste der Elemente in der CollectionBase-Instanz ab.

(Geerbt von CollectionBase)
Item[Int32]

Ruft eine CodeTypeReference am angegebenen Index in der Auflistung ab oder legt diese fest.

List

Ruft eine IList mit der Liste der Elemente in der CollectionBase-Instanz ab.

(Geerbt von CollectionBase)

Methoden

Add(CodeTypeReference)

Fügt der Auflistung den angegebenen CodeTypeReference hinzu.

Add(String)

Fügt der Auflistung unter Verwendung des angegebenen Datentypnamens einen CodeTypeReference hinzu.

Add(Type)

Fügt der Auflistung unter Verwendung des angegebenen Datentyps einen CodeTypeReference hinzu.

AddRange(CodeTypeReference[])

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

AddRange(CodeTypeReferenceCollection)

Fügt den Inhalt der angegebenen CodeTypeReferenceCollection am Ende der Auflistung hinzu.

Clear()

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

(Geerbt von CollectionBase)
Contains(CodeTypeReference)

Ruft einen Wert ab, der angibt, ob die Auflistung die angegebene CodeTypeReference enthält.

CopyTo(CodeTypeReference[], Int32)

Kopiert die Elemente in der Auflistung in das angegebene eindimensionale Array, beginnend beim angegebenen Index.

Equals(Object)

Bestimmt, ob das angegebene Objekt gleich dem aktuellen Objekt ist.

(Geerbt von Object)
GetEnumerator()

Gibt einen Enumerator zurück, der die CollectionBase durchläuft.

(Geerbt von CollectionBase)
GetHashCode()

Fungiert als Standardhashfunktion.

(Geerbt von Object)
GetType()

Ruft den Type der aktuellen Instanz ab.

(Geerbt von Object)
IndexOf(CodeTypeReference)

Ruft den Index in der Auflistung der angegebenen CodeTypeReference ab, sofern sie in der Auflistung vorhanden ist.

Insert(Int32, CodeTypeReference)

Fügt ein CodeTypeReference-Objekt am angegebenen Index in die Auflistung ein.

MemberwiseClone()

Erstellt eine flache Kopie des aktuellen Object.

(Geerbt von Object)
OnClear()

Führt beim Löschen des Inhalts der CollectionBase-Instanz zusätzliche benutzerdefinierte Prozesse aus.

(Geerbt von CollectionBase)
OnClearComplete()

Führt nach dem Löschen des Inhalts der CollectionBase-Instanz zusätzliche benutzerdefinierte Prozesse aus.

(Geerbt von CollectionBase)
OnInsert(Int32, Object)

Führt zusätzliche benutzerdefinierte Prozesse vor dem Einfügen eines neuen Elements in die CollectionBase-Instanz aus.

(Geerbt von CollectionBase)
OnInsertComplete(Int32, Object)

Führt zusätzliche benutzerdefinierte Prozesse nach dem Einfügen eines neuen Elements in die CollectionBase-Instanz aus.

(Geerbt von CollectionBase)
OnRemove(Int32, Object)

Führt zusätzliche benutzerdefinierte Prozesse beim Entfernen eines Elements aus der CollectionBase-Instanz aus.

(Geerbt von CollectionBase)
OnRemoveComplete(Int32, Object)

Führt zusätzliche benutzerdefinierte Prozesse nach dem Entfernen eines Elements aus der CollectionBase-Instanz aus.

(Geerbt von CollectionBase)
OnSet(Int32, Object, Object)

Führt zusätzliche benutzerdefinierte Prozesse vor dem Festlegen eines Werts in der CollectionBase-Instanz aus.

(Geerbt von CollectionBase)
OnSetComplete(Int32, Object, Object)

Führt zusätzliche benutzerdefinierte Prozesse nach dem Festlegen eines Werts in der CollectionBase-Instanz aus.

(Geerbt von CollectionBase)
OnValidate(Object)

Führt zusätzliche benutzerdefinierte Prozesse beim Validieren eines Werts aus.

(Geerbt von CollectionBase)
Remove(CodeTypeReference)

Entfernt den angegebenen CodeTypeReference aus der Auflistung.

RemoveAt(Int32)

Entfernt das Element am angegebenen Index aus der CollectionBase-Instanz. Diese Methode kann nicht überschrieben werden.

(Geerbt von CollectionBase)
ToString()

Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt.

(Geerbt von Object)

Explizite Schnittstellenimplementierungen

ICollection.CopyTo(Array, Int32)

Kopiert die gesamte CollectionBase-Instanz in ein kompatibles eindimensionales 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 (threadsicher) ist.

(Geerbt von CollectionBase)
ICollection.SyncRoot

Ruft ein Objekt ab, mit dem der Zugriff auf CollectionBase synchronisiert werden kann.

(Geerbt von CollectionBase)
IList.Add(Object)

Fügt am Ende der CollectionBase ein Objekt hinzu.

(Geerbt von CollectionBase)
IList.Contains(Object)

Ermittelt, ob CollectionBase 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 der gesamten CollectionBase zurück.

(Geerbt von CollectionBase)
IList.Insert(Int32, Object)

Fügt am angegebenen Index ein Element in die CollectionBase ein.

(Geerbt von CollectionBase)
IList.IsFixedSize

Ruft einen Wert ab, der angibt, ob das CollectionBase eine feste Größe aufweist.

(Geerbt von CollectionBase)
IList.IsReadOnly

Ruft einen Wert ab, der angibt, ob das CollectionBase schreibgeschützt ist.

(Geerbt von CollectionBase)
IList.Item[Int32]

Ruft das Element am angegebenen Index ab oder legt dieses fest.

(Geerbt von CollectionBase)
IList.Remove(Object)

Entfernt das erste Vorkommen eines angegebenen Objekts aus der CollectionBase.

(Geerbt von CollectionBase)

Erweiterungsmethoden

Cast<TResult>(IEnumerable)

Wandelt die Elemente eines IEnumerable in den angegebenen Typ um

OfType<TResult>(IEnumerable)

Filtert die Elemente eines IEnumerable anhand eines angegebenen Typs

AsParallel(IEnumerable)

Ermöglicht die Parallelisierung einer Abfrage.

AsQueryable(IEnumerable)

Konvertiert einen IEnumerable in einen IQueryable.

Gilt für

Siehe auch