Lookup<TKey,TElement>.Count Eigenschaft

Definition

Ruft die Anzahl der Schlüssel-Wert-Paare in der Auflistung im Lookup<TKey,TElement> ab.

public:
 property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer

Eigenschaftswert

Die Anzahl der Schlüssel-Wert-Paare in der Auflistung im Lookup<TKey,TElement>.

Implementiert

Beispiele

Im folgenden Beispiel wird veranschaulicht, wie Count die Anzahl der Schlüssel-Wert-Sammlungspaare in einem Lookup<TKey,TElement>bestimmt wird. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die Lookup<TKey,TElement>-Klasse bereitgestellt wird.

// Get the number of key-collection pairs in the Lookup.
int count = lookup.Count;
' Get the number of key-collection pairs in the Lookup.
Dim count As Integer = lookup.Count

Hinweise

Der Wert der Count -Eigenschaft ändert sich nicht, da Einem Objekt nach der Erstellung keine Elemente hinzugefügt oder daraus entfernt Lookup<TKey,TElement> werden können.

Gilt für: