Editar

Partilhar via


WeakReference<T> Constructors

Definition

Initializes a new instance of the WeakReference<T> class.

Overloads

WeakReference<T>(T)

Initializes a new instance of the WeakReference<T> class that references the specified object.

WeakReference<T>(T, Boolean)

Initializes a new instance of the WeakReference<T> class that references the specified object and uses the specified resurrection tracking.

WeakReference<T>(T)

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

Initializes a new instance of the WeakReference<T> class that references the specified object.

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)

Parameters

target
T

The object to reference, or null.

Applies to

WeakReference<T>(T, Boolean)

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

Initializes a new instance of the WeakReference<T> class that references the specified object and uses the specified resurrection tracking.

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)

Parameters

target
T

The object to reference, or null.

trackResurrection
Boolean

true to track the object after finalization; false to track the object only until finalization.

Applies to