CollectionExtensions.Remove<TKey,TValue>(IDictionary<TKey,TValue>, TKey, TValue) Metoda
Definicja
Próbuje usunąć wartość z określonym key
z dictionary
.Tries to remove the value with the specified key
from the dictionary
.
public:
generic <typename TKey, typename TValue>
[System::Runtime::CompilerServices::Extension]
static bool Remove(System::Collections::Generic::IDictionary<TKey, TValue> ^ dictionary, TKey key, [Runtime::InteropServices::Out] TValue % value);
public static bool Remove<TKey,TValue> (this System.Collections.Generic.IDictionary<TKey,TValue> dictionary, TKey key, out TValue value);
static member Remove : System.Collections.Generic.IDictionary<'Key, 'Value> * 'Key * 'Value -> bool
<Extension()>
Public Function Remove(Of TKey, TValue) (dictionary As IDictionary(Of TKey, TValue), key As TKey, ByRef value As TValue) As Boolean
Parametry typu
- TKey
Typ kluczy w dictionary
.The type of the keys in the dictionary
.
- TValue
Typ wartości w dictionary
.The type of the values in the dictionary
.
Parametry
- dictionary
- IDictionary<TKey,TValue>
Słownik z kluczami typu TKey
i wartości typu TValue
.A dictionary with keys of type TKey
and values of type TValue
.
- key
- TKey
Klucz wartości do usunięcia.The key of the value to remove.
- value
- TValue
Gdy ta metoda zwraca true
, usunięta wartość; gdy ta metoda zwraca false
, default
wartość dla TValue
.When this method returns true
, the removed value; when this method returns false
, the default
value for TValue
.
Zwraca
true
gdy wartość zostanie znaleziona w dictionary
z określonym;, key
false
gdy dictionary
nie można znaleźć wartości skojarzonej z określonym key
.true
when a value is found in the dictionary
with the specified key
; false
when the dictionary
cannot find a value associated with the specified key
.
Wyjątki
dictionary
to null
.dictionary
is null
.