This enum represents the the 4 different types of GCHandlesthat can be allocated by the GCHandle class. The type of handles are Normal, Weak, WeakTrackResurrection and Pinned
[Visual Basic] Public Enum GCHandleType [C#] public enum GCHandleType [C++] public enum GCHandleType
[JScript] In JScript, you can use the enumerations in the NGWS frameworks, but you cannot define your own.
Member Name | Description |
---|---|
Normal | This handle type prevents the object from being collected. |
Pinned | This handle type is the same as normal, but allows the address of the actual object to be taken. |
Weak | This handle type allows object to be collected. When this happens, the handle contents in the GCHandle instance will be zeroed. Weak references are zeroed before the finalizer runs, so if the object is resurrected in the finalizer, the weak reference is still zeroed. |
WeakTrackResurrection | This handle type is basically the same as Weak, but the handle is not zeroed if the object is resurrected. |
Namespace: System.Runtime.InteropServices
Assembly: mscorlib.dll