CefPrintDialogCallback.g.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //
  2. // DO NOT MODIFY! THIS IS AUTOGENERATED FILE!
  3. //
  4. namespace Xilium.CefGlue
  5. {
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Diagnostics;
  9. using System.Runtime.InteropServices;
  10. using System.Threading;
  11. using Xilium.CefGlue.Interop;
  12. // Role: PROXY
  13. public sealed unsafe partial class CefPrintDialogCallback : IDisposable
  14. {
  15. internal static CefPrintDialogCallback FromNative(cef_print_dialog_callback_t* ptr)
  16. {
  17. return new CefPrintDialogCallback(ptr);
  18. }
  19. internal static CefPrintDialogCallback FromNativeOrNull(cef_print_dialog_callback_t* ptr)
  20. {
  21. if (ptr == null) return null;
  22. return new CefPrintDialogCallback(ptr);
  23. }
  24. private cef_print_dialog_callback_t* _self;
  25. private int _disposed = 0;
  26. private CefPrintDialogCallback(cef_print_dialog_callback_t* ptr)
  27. {
  28. if (ptr == null) throw new ArgumentNullException("ptr");
  29. _self = ptr;
  30. CefObjectTracker.Track(this);
  31. }
  32. ~CefPrintDialogCallback()
  33. {
  34. if (Interlocked.CompareExchange(ref _disposed, 1, 0) == 0)
  35. {
  36. Release();
  37. _self = null;
  38. }
  39. }
  40. public void Dispose()
  41. {
  42. if (Interlocked.CompareExchange(ref _disposed, 1, 0) == 0)
  43. {
  44. Release();
  45. _self = null;
  46. }
  47. CefObjectTracker.Untrack(this);
  48. GC.SuppressFinalize(this);
  49. }
  50. internal void AddRef()
  51. {
  52. cef_print_dialog_callback_t.add_ref(_self);
  53. }
  54. internal bool Release()
  55. {
  56. return cef_print_dialog_callback_t.release(_self) != 0;
  57. }
  58. internal bool HasOneRef
  59. {
  60. get { return cef_print_dialog_callback_t.has_one_ref(_self) != 0; }
  61. }
  62. internal bool HasAtLeastOneRef
  63. {
  64. get { return cef_print_dialog_callback_t.has_at_least_one_ref(_self) != 0; }
  65. }
  66. internal cef_print_dialog_callback_t* ToNative()
  67. {
  68. AddRef();
  69. return _self;
  70. }
  71. }
  72. }