Retrieves or assigns the object an IsAlive status.
[Visual Basic] Overridable Public Property Target As Object [C#] public object Target {virtual get; virtual set;} [C++] public: __property virtual Object* get_Target(); public: __property virtual void set_Target(Object*); [JScript] public function get Target() : Object; public function set Target(Object);
This property can have the following values:
Value | Description |
---|---|
null | IsAlive returns false, meaning that there are no more strong references to the current object. |
Object to which the current instance refers | IsAlive returns true. |
Exception Type | Condition |
---|---|
WeakReferenceException | If the object reference encapsulated by this instance is invalid. |
The Target property retrieves or assigns the object of the current instance a true or null based upon the status that is returned from IsAlive.
A WeakReferenceException will be thrown if the object reference encapsulated by this instance is invalid. This will occur if the current instance has been resurrected after a call to Finalize because Finalize destroys the underlying reference.
WeakReference Class | WeakReference Members | System Namespace | Object | GC | GCHandle