Fixed CustomAlgorithmInterface crash issue in dotnet core
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / CustomAlgorithmInterface.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.12
6 //
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
10 #define DOT_NET_CORE
11
12 #if (DOT_NET_CORE)
13 using System.Reflection;
14 #endif
15
16 namespace Tizen.NUI {
17
18 internal class CustomAlgorithmInterface : global::System.IDisposable {
19   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20   protected bool swigCMemOwn;
21
22   internal CustomAlgorithmInterface(global::System.IntPtr cPtr, bool cMemoryOwn) {
23     swigCMemOwn = cMemoryOwn;
24     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
25   }
26
27   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CustomAlgorithmInterface obj) {
28     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
29   }
30
31   ~CustomAlgorithmInterface() {
32     Dispose();
33   }
34
35   public virtual void Dispose() {
36     lock(this) {
37       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
38         if (swigCMemOwn) {
39           swigCMemOwn = false;
40           NDalicPINVOKE.delete_CustomAlgorithmInterface(swigCPtr);
41         }
42         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
43       }
44       global::System.GC.SuppressFinalize(this);
45     }
46   }
47
48   public virtual Actor GetNextFocusableActor(Actor current, Actor proposed, View.FocusDirection direction) {
49     Actor ret = new Actor(NDalicPINVOKE.CustomAlgorithmInterface_GetNextFocusableActor(swigCPtr, Actor.getCPtr(current), Actor.getCPtr(proposed), (int)direction), true);
50     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
51     return ret;
52   }
53
54   public CustomAlgorithmInterface() : this(NDalicPINVOKE.new_CustomAlgorithmInterface(), true) {
55     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
56     SwigDirectorConnect();
57   }
58
59   private void SwigDirectorConnect() {
60     if (SwigDerivedClassHasMethod("GetNextFocusableActor", swigMethodTypes0))
61       swigDelegate0 = new SwigDelegateCustomAlgorithmInterface_0(SwigDirectorGetNextFocusableActor);
62     NDalicPINVOKE.CustomAlgorithmInterface_director_connect(swigCPtr, swigDelegate0);
63   }
64
65 #if (DOT_NET_CORE)
66   private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
67     global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, methodTypes);
68     bool hasDerivedMethod = this.GetType().GetTypeInfo().IsSubclassOf(typeof(CustomAlgorithmInterface));
69     return hasDerivedMethod && (methodInfo != null);
70   }
71 #else
72   private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
73     global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null);
74     bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(CustomAlgorithmInterface));
75     return hasDerivedMethod;
76   }
77 #endif
78
79   private global::System.IntPtr SwigDirectorGetNextFocusableActor(global::System.IntPtr current, global::System.IntPtr proposed, int direction) {
80     return Actor.getCPtr(GetNextFocusableActor(new Actor(current, true), new Actor(proposed, true), (View.FocusDirection)direction)).Handle;
81   }
82
83   public delegate global::System.IntPtr SwigDelegateCustomAlgorithmInterface_0(global::System.IntPtr current, global::System.IntPtr proposed, int direction);
84
85   private SwigDelegateCustomAlgorithmInterface_0 swigDelegate0;
86
87   private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { typeof(Actor), typeof(Actor), typeof(View.FocusDirection) };
88 }
89
90 }