NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

WeakReference Constructor (Object, Boolean)

Initializes a new instance of the WeakReference class with the specified object and object tracking.

[Visual Basic]
Overloads Public Sub New( _
   ByVal target As Object, _
   ByVal trackResurrection As Boolean _
)
[C#]
public WeakReference(
   object target,
   bool trackResurrection
);
[C++]
public: WeakReference(
   Object* target,
   bool trackResurrection
);
[JScript]
public function WeakReference(
   target : Object,
   trackResurrection : Boolean
);

Parameters

target
The object to track.
trackResurrection
Determines when to stop tracking the object. If true, the object is tracked after finalization; otherwise, the object is only tracked until finalization.

Exceptions

Exception Type Condition
ArgumentException If the target object is null.

Remarks

This WeakReference constructor creates a weak reference to the specified object. The reference will refer to the target until the first time it is detected to be unreachable by the runtime. It returns a Boolean evaluation for the object tracking as follows:

See Also

WeakReference Class | WeakReference Members | System Namespace | WeakReference Constructor Overload List | Object | Boolean | GCHandle