Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ----------------------------------------------------------------------------
- // <auto-generated>
- // This is autogenerated code by CppSharp.
- // Do not edit this file or all your changes will be lost after re-generation.
- // </auto-generated>
- // ----------------------------------------------------------------------------
- using System;
- using System.Runtime.InteropServices;
- using System.Security;
- namespace CppTest
- {
- public unsafe partial class TagImage : IDisposable
- {
- public partial struct __Internal
- {
- internal int width;
- internal int height;
- internal global::System.IntPtr hDeviceContext;
- internal global::System.IntPtr hBitmapHandle;
- [SuppressUnmanagedCodeSecurity]
- [DllImport("CppTest", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
- EntryPoint="??0tagImage@@QEAA@AEBU0@@Z")]
- internal static extern global::System.IntPtr cctor(global::System.IntPtr instance, global::System.IntPtr _0);
- }
- public global::System.IntPtr __Instance { get; protected set; }
- protected int __PointerAdjustment;
- internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::CppTest.TagImage> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::CppTest.TagImage>();
- protected void*[] __OriginalVTables;
- protected bool __ownsNativeInstance;
- internal static global::CppTest.TagImage __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
- {
- return new global::CppTest.TagImage(native.ToPointer(), skipVTables);
- }
- internal static global::CppTest.TagImage __CreateInstance(global::CppTest.TagImage.__Internal native, bool skipVTables = false)
- {
- return new global::CppTest.TagImage(native, skipVTables);
- }
- private static void* __CopyValue(global::CppTest.TagImage.__Internal native)
- {
- var ret = Marshal.AllocHGlobal(sizeof(global::CppTest.TagImage.__Internal));
- *(global::CppTest.TagImage.__Internal*) ret = native;
- return ret.ToPointer();
- }
- private TagImage(global::CppTest.TagImage.__Internal native, bool skipVTables = false)
- : this(__CopyValue(native), skipVTables)
- {
- __ownsNativeInstance = true;
- NativeToManagedMap[__Instance] = this;
- }
- protected TagImage(void* native, bool skipVTables = false)
- {
- if (native == null)
- return;
- __Instance = new global::System.IntPtr(native);
- }
- public TagImage()
- {
- __Instance = Marshal.AllocHGlobal(sizeof(global::CppTest.TagImage.__Internal));
- __ownsNativeInstance = true;
- NativeToManagedMap[__Instance] = this;
- }
- public TagImage(global::CppTest.TagImage _0)
- {
- __Instance = Marshal.AllocHGlobal(sizeof(global::CppTest.TagImage.__Internal));
- __ownsNativeInstance = true;
- NativeToManagedMap[__Instance] = this;
- *((global::CppTest.TagImage.__Internal*) __Instance) = *((global::CppTest.TagImage.__Internal*) _0.__Instance);
- }
- ~TagImage()
- {
- Dispose(false);
- }
- public void Dispose()
- {
- Dispose(disposing: true);
- GC.SuppressFinalize(this);
- }
- public virtual void Dispose(bool disposing)
- {
- if (__Instance == IntPtr.Zero)
- return;
- global::CppTest.TagImage __dummy;
- NativeToManagedMap.TryRemove(__Instance, out __dummy);
- if (__ownsNativeInstance)
- Marshal.FreeHGlobal(__Instance);
- __Instance = IntPtr.Zero;
- }
- public int Width
- {
- get
- {
- return ((global::CppTest.TagImage.__Internal*) __Instance)->width;
- }
- set
- {
- ((global::CppTest.TagImage.__Internal*)__Instance)->width = value;
- }
- }
- public int Height
- {
- get
- {
- return ((global::CppTest.TagImage.__Internal*) __Instance)->height;
- }
- set
- {
- ((global::CppTest.TagImage.__Internal*)__Instance)->height = value;
- }
- }
- }
- public unsafe partial class CppTest
- {
- public partial struct __Internal
- {
- [SuppressUnmanagedCodeSecurity]
- [DllImport("CppTest", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
- EntryPoint="?DeleteImage@@YAHPEAUtagImage@@@Z")]
- internal static extern int DeleteImage(global::System.IntPtr image);
- }
- public static int DeleteImage(global::CppTest.TagImage image)
- {
- var __arg0 = ReferenceEquals(image, null) ? global::System.IntPtr.Zero : image.__Instance;
- var __ret = __Internal.DeleteImage(__arg0);
- return __ret;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement