MsrpCallback.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.9
  4. *
  5. * Do not make changes to this file unless you know what you are doing--modify
  6. * the SWIG interface file instead.
  7. * ----------------------------------------------------------------------------- */
  8. namespace org.doubango.tinyWRAP {
  9. using System;
  10. using System.Runtime.InteropServices;
  11. public class MsrpCallback : IDisposable {
  12. private HandleRef swigCPtr;
  13. protected bool swigCMemOwn;
  14. internal MsrpCallback(IntPtr cPtr, bool cMemoryOwn) {
  15. swigCMemOwn = cMemoryOwn;
  16. swigCPtr = new HandleRef(this, cPtr);
  17. }
  18. internal static HandleRef getCPtr(MsrpCallback obj) {
  19. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  20. }
  21. ~MsrpCallback() {
  22. Dispose();
  23. }
  24. public virtual void Dispose() {
  25. lock(this) {
  26. if (swigCPtr.Handle != IntPtr.Zero) {
  27. if (swigCMemOwn) {
  28. swigCMemOwn = false;
  29. tinyWRAPPINVOKE.delete_MsrpCallback(swigCPtr);
  30. }
  31. swigCPtr = new HandleRef(null, IntPtr.Zero);
  32. }
  33. GC.SuppressFinalize(this);
  34. }
  35. }
  36. public MsrpCallback() : this(tinyWRAPPINVOKE.new_MsrpCallback(), true) {
  37. SwigDirectorConnect();
  38. }
  39. public virtual int OnEvent(MsrpEvent e) {
  40. int ret = (SwigDerivedClassHasMethod("OnEvent", swigMethodTypes0) ? tinyWRAPPINVOKE.MsrpCallback_OnEventSwigExplicitMsrpCallback(swigCPtr, MsrpEvent.getCPtr(e)) : tinyWRAPPINVOKE.MsrpCallback_OnEvent(swigCPtr, MsrpEvent.getCPtr(e)));
  41. return ret;
  42. }
  43. private void SwigDirectorConnect() {
  44. if (SwigDerivedClassHasMethod("OnEvent", swigMethodTypes0))
  45. swigDelegate0 = new SwigDelegateMsrpCallback_0(SwigDirectorOnEvent);
  46. tinyWRAPPINVOKE.MsrpCallback_director_connect(swigCPtr, swigDelegate0);
  47. }
  48. private bool SwigDerivedClassHasMethod(string methodName, Type[] methodTypes) {
  49. System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance, null, methodTypes, null);
  50. bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(MsrpCallback));
  51. return hasDerivedMethod;
  52. }
  53. private int SwigDirectorOnEvent(IntPtr e) {
  54. return OnEvent((e == IntPtr.Zero) ? null : new MsrpEvent(e, false));
  55. }
  56. public delegate int SwigDelegateMsrpCallback_0(IntPtr e);
  57. private SwigDelegateMsrpCallback_0 swigDelegate0;
  58. private static Type[] swigMethodTypes0 = new Type[] { typeof(MsrpEvent) };
  59. }
  60. }