Freigeben über


ConditionalWeakTable<TKey, TValue>.Remove Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Removes a key and its value from the table.

Namespace:  System.Runtime.CompilerServices
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
<SecuritySafeCriticalAttribute> _
Public Function Remove ( _
    key As TKey _
) As Boolean
[SecuritySafeCriticalAttribute]
public bool Remove(
    TKey key
)

Parameters

  • key
    Type: TKey
    The key to remove.

Return Value

Type: System.Boolean
true if the key is found and removed; otherwise, false.

Exceptions

Exception Condition
ArgumentNullException

key is nulla null reference (Nothing in Visual Basic).

Remarks

If the key is garbage-collected during this operation, the method does not raise an exception and the return value is undefined.

Version Information

Silverlight

Supported in: 5, 4

Permissions

  • SecurityCriticalAttribute 

    requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.