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.Target

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);

Property Value

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.

Exceptions

Exception Type Condition
WeakReferenceException If the object reference encapsulated by this instance is invalid.

Remarks

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.

See Also

WeakReference Class | WeakReference Members | System Namespace | Object | GC | GCHandle