Export (0) Print
Expand All

WeakReference.IsAlive Property

Gets an indication whether the object referenced by this instance has been garbage collected.

[Visual Basic]
Public Overridable ReadOnly Property IsAlive As Boolean
[C#]
public virtual bool IsAlive {get;}
[C++]
public: __property virtual bool get_IsAlive();
[JScript]
public function get IsAlive() : Boolean;

Property Value

true if the object referenced by this instance has not been garbage collected and is still accessible; otherwise, false.

Exceptions

Exception Type Condition
InvalidOperationException The reference to the target object is invalid.

Remarks

An exception is thrown if the object referenced by this instance is invalid. This can occur if there is an attempt to resurrect the referenced object after it has been finalized.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

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

Show:
© 2014 Microsoft