ConditionalWeakTable<TKey,TValue> 构造函数

定义

初始化 ConditionalWeakTable<TKey,TValue> 类的新实例。Initializes a new instance of the ConditionalWeakTable<TKey,TValue> class.

public:
 ConditionalWeakTable();
public ConditionalWeakTable ();
Public Sub New ()

注解

ConditionalWeakTable<TKey,TValue>构造函数实例化一个空 ConditionalWeakTable<TKey,TValue> 表,即表不包含键/值对。The ConditionalWeakTable<TKey,TValue> constructor instantiates an empty ConditionalWeakTable<TKey,TValue> table; that is, the table contains no key/value pairs. 可以通过调用 Add 、或方法添加键/值对 GetValue GetOrCreateValueYou can add key/value pairs by calling the Add, GetValue, or GetOrCreateValue method.

对象中的每个键 ConditionalWeakTable<TKey,TValue> 都必须是唯一的。Every key in a ConditionalWeakTable<TKey,TValue> object must be unique. 如果键引用相同的对象,则它们不是唯一的 (也就是说,如果将它们作为参数传递给方法,将 Object.ReferenceEquals 返回 true) 。Keys are not unique if they refer to the same object (that is, if passing them as arguments to the Object.ReferenceEquals method returns true).

适用于