public struct GCHandle
|
See GCHandleType for more information about the different GCHandleType values used by the common language runtime.
| IsAllocated | Read-only Gets a value indicating whether the handle is allocated. |
| Target | Read-write Gets and sets the object this handle represents. |
| AddrOfPinnedObject | Retrieves the address of an object in a GCHandleType.Pinned handle. |
| Alloc | Overloaded:Alloc(object value) Allocates a GCHandleType.Normal handle for the specified object. |
| Alloc | Overloaded:Alloc(object value, GCHandleType type) Allocates a handle of the specified type for the specified object. |
| Equals (inherited from System.ValueType) |
See base class member description: System.ValueType.Equals Indicates whether this instance and a specified object are equal. |
| Free | Releases a GCHandle. |
| GetHashCode (inherited from System.ValueType) |
See base class member description: System.ValueType.GetHashCode Returns the hash code for this instance. |
| GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
| ToString (inherited from System.ValueType) |
See base class member description: System.ValueType.ToString Returns the fully qualified type name of this instance. |
| op_Explicit (convert System.Runtime.InteropServices.GCHandle to System.IntPtr) |
Overloaded:op_Explicit(GCHandle value) A GCHandle is stored using an internal integer representation. This method can be used to retrieve the integer value from a GCHandle. |
| op_Explicit (convert System.IntPtr to System.Runtime.InteropServices.GCHandle) |
Overloaded:op_Explicit(IntPtr value) A GCHandle is stored using an internal integer representation. This method allows you to retrieve a GCHandle from an integer value. |
| Finalize (inherited from System.Object) |
See base class member description: System.Object.Finalize Derived from System.Object, the primary base class for all objects. |
| MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Hierarchy:
public bool IsAllocated {get;}
|
public object Target {get; set;}
|
| Exception Type | Condition |
|---|---|
| InvalidOperationException | The handle was freed, or never initialized. |
public IntPtr AddrOfPinnedObject(); |
| Exception Type | Condition |
|---|---|
| InvalidOperationException | The handle is any type other than GCHandleType.Pinned. |
value
public static GCHandle Alloc( |
value
type
obj
~GCHandle(); |
public void Free(); |
| Exception Type | Condition |
|---|---|
| InvalidOperationException | The handle was freed or never initialized. |
public override int GetHashCode(); |
For more information, see Object.GetHashCode, and Hashtable.
public Type GetType(); |
protected object MemberwiseClone(); |
value
value
public override string ToString(); |