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!

GCHandle.IsAllocated

This method can be used to determine if the handle is still allocated. This method is particularly useful when using weak handles GCHandleType- Weak) since it provides a way of determining if the GC handle is still available. When the GC attempts to collect the object, the latter could still be resurrected in the finalizer. In this case, the handle will not be allocated (this is lost when the GC attempts to collect the object) although the Target object is valid.

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

Property Value

Returns true if the handle is allocated, else false.

See Also

GCHandle Structure | GCHandle Members | System.Runtime.InteropServices Namespace