SortedDictionary<TKey,TValue>.KeyCollection.ICollection<TKey>.Remove Metod

Definition

Tar bort den första förekomsten av ett specifikt objekt från ICollection<T>. Den här implementeringen genererar alltid en NotSupportedException.

 virtual bool System.Collections.Generic.ICollection<TKey>.Remove(TKey item) = System::Collections::Generic::ICollection<TKey>::Remove;
bool ICollection<TKey>.Remove(TKey item);
abstract member System.Collections.Generic.ICollection<TKey>.Remove : 'Key -> bool
override this.System.Collections.Generic.ICollection<TKey>.Remove : 'Key -> bool
Function Remove (item As TKey) As Boolean Implements ICollection(Of TKey).Remove

Parametrar

item
TKey

Objektet som ska tas bort från ICollection<T>.

Returer

true om objektet har tagits bort från ICollection<T>, annars , false. Den här metoden returnerar false även om objektet inte hittas ICollection<T>i .

Implementeringar

Undantag

Kastas alltid; samlingen är skrivskyddad.

Kommentarer

Implementeringar kan variera i hur de bestämmer objektens likhet. använder Defaulttill exempel List<T> , medan SortedDictionary<TKey,TValue> tillåter användaren att ange vilken implementering som IComparer<T> ska användas för att jämföra nycklar.

Gäller för

Se även