ImmutableInterlocked.TryRemove<TKey,TValue> 方法

定義

將有指定索引鍵的元素移除 (如果索引鍵存在)。

public:
generic <typename TKey, typename TValue>
 static bool TryRemove(System::Collections::Immutable::ImmutableDictionary<TKey, TValue> ^ % location, TKey key, [Runtime::InteropServices::Out] TValue % value);
public static bool TryRemove<TKey,TValue> (ref System.Collections.Immutable.ImmutableDictionary<TKey,TValue> location, TKey key, out TValue value);
static member TryRemove : ImmutableDictionary * 'Key * 'Value -> bool
Public Shared Function TryRemove(Of TKey, TValue) (ByRef location As ImmutableDictionary(Of TKey, TValue), key As TKey, ByRef value As TValue) As Boolean

類型參數

TKey

集合中所包含之索引鍵的類型。

TValue

集合中所包含之值的類型。

參數

location
ImmutableDictionary<TKey,TValue>

要更新的字典。

key
TKey

要移除的索引鍵。

value
TValue

接收移除之項目的值 (如果字典不是空的)。

傳回

如果已找到並移除索引鍵則為 true,否則為 false

適用於