WeakReference<T> 构造函数

定义

初始化 WeakReference<T> 类的新实例。

重载

WeakReference<T>(T)

初始化引用指定对象的 WeakReference<T> 类的新实例。

WeakReference<T>(T, Boolean)

初始化 WeakReference<T> 类的新实例,该类引用指定的对象并使用指定的复活跟踪。

WeakReference<T>(T)

Source:
WeakReference.T.cs
Source:
WeakReference.T.cs
Source:
WeakReference.T.cs

初始化引用指定对象的 WeakReference<T> 类的新实例。

public:
 WeakReference(T target);
public WeakReference (T target);
new WeakReference<'T (requires 'T : null)> : 'T -> WeakReference<'T (requires 'T : null)>
Public Sub New (target As T)

参数

target
T

要引用的对象或为 null

适用于

WeakReference<T>(T, Boolean)

Source:
WeakReference.T.cs
Source:
WeakReference.T.cs
Source:
WeakReference.T.cs

初始化 WeakReference<T> 类的新实例,该类引用指定的对象并使用指定的复活跟踪。

public:
 WeakReference(T target, bool trackResurrection);
public WeakReference (T target, bool trackResurrection);
new WeakReference<'T (requires 'T : null)> : 'T * bool -> WeakReference<'T (requires 'T : null)>
Public Sub New (target As T, trackResurrection As Boolean)

参数

target
T

要引用的对象或为 null

trackResurrection
Boolean

若要在终结后跟踪对象,则为 true;若要仅在终结前跟踪对象,则为 false

适用于