System.Runtime.InteropServices.GCHandle.InternalAlloc C# (CSharp) Method

InternalAlloc() private method

private InternalAlloc ( Object value, GCHandleType type ) : IntPtr
value Object
type GCHandleType
return System.IntPtr
        internal static extern IntPtr InternalAlloc(Object value, GCHandleType type);
        [MethodImplAttribute(MethodImplOptions.InternalCall)]

Usage Example

Esempio n. 1
0
 internal GCHandle(object value, GCHandleType type)
 {
     if (type > GCHandleType.Pinned)
     {
         throw new ArgumentOutOfRangeException("type", Environment.GetResourceString("ArgumentOutOfRange_Enum"));
     }
     this.m_handle = GCHandle.InternalAlloc(value, type);
     if (type == GCHandleType.Pinned)
     {
         this.SetIsPinned();
     }
 }