IsAlive Property
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Gets an indication whether the object referenced by the current WeakReference object has been garbage collected.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
Public Overridable ReadOnly Property IsAlive As Boolean
public virtual bool IsAlive { get; }
public:
virtual property bool IsAlive {
bool get ();
}
abstract IsAlive : bool with get
override IsAlive : bool with get
function get IsAlive () : boolean
Property Value
Type: System. . :: . .Boolean
true if the object referenced by the current WeakReference object has not been garbage collected and is still accessible; otherwise, false.
Remarks
Because an object could potentially be reclaimed for garbage collection immediately after the IsAlive property returns true, using this property is not recommended unless you are testing only for a false return value.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.