ConditionalWeakTable<TKey,TValue>.Remove 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| Remove(TKey) |
從數據表中移除索引鍵及其值。 |
| Remove(TKey, TValue) |
從表格中移除一個鍵及其值,若有該值則回傳該值。 |
Remove(TKey)
從數據表中移除索引鍵及其值。
public:
bool Remove(TKey key);
public bool Remove(TKey key);
member this.Remove : 'Key -> bool
Public Function Remove (key As TKey) As Boolean
參數
- key
- TKey
要移除的關鍵。
傳回
true如果鑰匙被找到並移除;否則,。 false
例外狀況
key 是 null。
備註
若在此操作中金鑰被垃圾回收,方法不會產生例外,且回傳值未定義。
適用於
Remove(TKey, TValue)
從表格中移除一個鍵及其值,若有該值則回傳該值。
public:
bool Remove(TKey key, [Runtime::InteropServices::Out] TValue % value);
public bool Remove(TKey key, out TValue value);
member this.Remove : 'Key * 'Value -> bool
Public Function Remove (key As TKey, ByRef value As TValue) As Boolean
參數
- key
- TKey
要移除的關鍵。
- value
- TValue
當此方法回傳時,包含從表格中移除的值(若該值存在)。
傳回
true如果鑰匙被找到並移除;否則,。 false
例外狀況
key 是 null。