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 );
Exception Type | Condition |
---|---|
ArgumentException | If the target object is null. |
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:
WeakReference Class | WeakReference Members | System Namespace | WeakReference Constructor Overload List | Object | Boolean | GCHandle