Advertisement
Naohiro19

CppSharp Generated Original Source code

Feb 9th, 2019
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.26 KB | None | 0 0
  1. // ----------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This is autogenerated code by CppSharp.
  4. // Do not edit this file or all your changes will be lost after re-generation.
  5. // </auto-generated>
  6. // ----------------------------------------------------------------------------
  7. using System;
  8. using System.Runtime.InteropServices;
  9. using System.Security;
  10.  
  11. namespace CppTest
  12. {
  13.     public unsafe partial class TagImage : IDisposable
  14.     {
  15.         public partial struct __Internal
  16.         {
  17.             internal int width;
  18.  
  19.             internal int height;
  20.  
  21.             internal global::System.IntPtr hDeviceContext;
  22.  
  23.             internal global::System.IntPtr hBitmapHandle;
  24.  
  25.             [SuppressUnmanagedCodeSecurity]
  26.             [DllImport("CppTest", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  27.                 EntryPoint="??0tagImage@@QEAA@AEBU0@@Z")]
  28.             internal static extern global::System.IntPtr cctor(global::System.IntPtr instance, global::System.IntPtr _0);
  29.         }
  30.  
  31.         public global::System.IntPtr __Instance { get; protected set; }
  32.  
  33.         protected int __PointerAdjustment;
  34.         internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::CppTest.TagImage> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::CppTest.TagImage>();
  35.         protected void*[] __OriginalVTables;
  36.  
  37.         protected bool __ownsNativeInstance;
  38.  
  39.         internal static global::CppTest.TagImage __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
  40.         {
  41.             return new global::CppTest.TagImage(native.ToPointer(), skipVTables);
  42.         }
  43.  
  44.         internal static global::CppTest.TagImage __CreateInstance(global::CppTest.TagImage.__Internal native, bool skipVTables = false)
  45.         {
  46.             return new global::CppTest.TagImage(native, skipVTables);
  47.         }
  48.  
  49.         private static void* __CopyValue(global::CppTest.TagImage.__Internal native)
  50.         {
  51.             var ret = Marshal.AllocHGlobal(sizeof(global::CppTest.TagImage.__Internal));
  52.             *(global::CppTest.TagImage.__Internal*) ret = native;
  53.             return ret.ToPointer();
  54.         }
  55.  
  56.         private TagImage(global::CppTest.TagImage.__Internal native, bool skipVTables = false)
  57.             : this(__CopyValue(native), skipVTables)
  58.         {
  59.             __ownsNativeInstance = true;
  60.             NativeToManagedMap[__Instance] = this;
  61.         }
  62.  
  63.         protected TagImage(void* native, bool skipVTables = false)
  64.         {
  65.             if (native == null)
  66.                 return;
  67.             __Instance = new global::System.IntPtr(native);
  68.         }
  69.  
  70.         public TagImage()
  71.         {
  72.             __Instance = Marshal.AllocHGlobal(sizeof(global::CppTest.TagImage.__Internal));
  73.             __ownsNativeInstance = true;
  74.             NativeToManagedMap[__Instance] = this;
  75.         }
  76.  
  77.         public TagImage(global::CppTest.TagImage _0)
  78.         {
  79.             __Instance = Marshal.AllocHGlobal(sizeof(global::CppTest.TagImage.__Internal));
  80.             __ownsNativeInstance = true;
  81.             NativeToManagedMap[__Instance] = this;
  82.             *((global::CppTest.TagImage.__Internal*) __Instance) = *((global::CppTest.TagImage.__Internal*) _0.__Instance);
  83.         }
  84.  
  85.         ~TagImage()
  86.         {
  87.             Dispose(false);
  88.         }
  89.  
  90.         public void Dispose()
  91.         {
  92.             Dispose(disposing: true);
  93.             GC.SuppressFinalize(this);
  94.         }
  95.  
  96.         public virtual void Dispose(bool disposing)
  97.         {
  98.             if (__Instance == IntPtr.Zero)
  99.                 return;
  100.             global::CppTest.TagImage __dummy;
  101.             NativeToManagedMap.TryRemove(__Instance, out __dummy);
  102.             if (__ownsNativeInstance)
  103.                 Marshal.FreeHGlobal(__Instance);
  104.             __Instance = IntPtr.Zero;
  105.         }
  106.  
  107.         public int Width
  108.         {
  109.             get
  110.             {
  111.                 return ((global::CppTest.TagImage.__Internal*) __Instance)->width;
  112.             }
  113.  
  114.             set
  115.             {
  116.                 ((global::CppTest.TagImage.__Internal*)__Instance)->width = value;
  117.             }
  118.         }
  119.  
  120.         public int Height
  121.         {
  122.             get
  123.             {
  124.                 return ((global::CppTest.TagImage.__Internal*) __Instance)->height;
  125.             }
  126.  
  127.             set
  128.             {
  129.                 ((global::CppTest.TagImage.__Internal*)__Instance)->height = value;
  130.             }
  131.         }
  132.     }
  133.  
  134.     public unsafe partial class CppTest
  135.     {
  136.         public partial struct __Internal
  137.         {
  138.             [SuppressUnmanagedCodeSecurity]
  139.             [DllImport("CppTest", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  140.                 EntryPoint="?DeleteImage@@YAHPEAUtagImage@@@Z")]
  141.             internal static extern int DeleteImage(global::System.IntPtr image);
  142.         }
  143.  
  144.         public static int DeleteImage(global::CppTest.TagImage image)
  145.         {
  146.             var __arg0 = ReferenceEquals(image, null) ? global::System.IntPtr.Zero : image.__Instance;
  147.             var __ret = __Internal.DeleteImage(__arg0);
  148.             return __ret;
  149.         }
  150.     }
  151. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement