[Tizen] Remove multiple ...
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Degree.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.9
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
11 namespace Tizen.NUI
12 {
13
14     /// <summary>
15     /// An angle in degrees.<br>
16     /// This reduces ambiguity when using methods which accept angles in degrees or radians.<br>
17     /// </summary>
18     public class Degree : global::System.IDisposable
19     {
20         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21         protected bool swigCMemOwn;
22
23         internal Degree(global::System.IntPtr cPtr, bool cMemoryOwn)
24         {
25             swigCMemOwn = cMemoryOwn;
26             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
27         }
28
29         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Degree obj)
30         {
31             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
32         }
33
34         //A Flag to check who called Dispose(). (By User or DisposeQueue)
35         private bool isDisposeQueued = false;
36         //A Flat to check if it is already disposed.
37         protected bool disposed = false;
38
39         ~Degree()
40         {
41             if(!isDisposeQueued)
42             {
43                 isDisposeQueued = true;
44                 DisposeQueue.Instance.Add(this);
45             }
46         }
47         public void Dispose()
48         {
49             //Throw excpetion if Dispose() is called in separate thread.
50             if (!Window.IsInstalled())
51             {
52                 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
53             }
54
55             if (isDisposeQueued)
56             {
57                 Dispose(DisposeTypes.Implicit);
58             }
59             else
60             {
61                 Dispose(DisposeTypes.Explicit);
62                 System.GC.SuppressFinalize(this);
63             }
64         }
65
66         protected virtual void Dispose(DisposeTypes type)
67         {
68             if (disposed)
69             {
70                 return;
71             }
72
73             if(type == DisposeTypes.Explicit)
74             {
75                 //Called by User
76                 //Release your own managed resources here.
77                 //You should release all of your own disposable objects here.
78             }
79
80             //Release your own unmanaged resources here.
81             //You should not access any managed member here except static instance.
82             //because the execution order of Finalizes is non-deterministic.
83
84             if (swigCPtr.Handle != global::System.IntPtr.Zero)
85             {
86                 if (swigCMemOwn)
87                 {
88                     swigCMemOwn = false;
89                     NDalicPINVOKE.delete_Degree(swigCPtr);
90                 }
91                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
92             }
93             disposed = true;
94         }
95
96         /// <summary>
97         /// Constructor.
98         /// </summary>
99         public Degree() : this(NDalicPINVOKE.new_Degree__SWIG_0(), true)
100         {
101             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
102         }
103
104         /// <summary>
105         /// Creates an angle in degrees.
106         /// </summary>
107         /// <param name="value">The initial value in degrees</param>
108         public Degree(float value) : this(NDalicPINVOKE.new_Degree__SWIG_1(value), true)
109         {
110             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
111         }
112
113         /// <summary>
114         /// Creates an angle in degrees from a Radian.
115         /// </summary>
116         /// <param name="value">The initial value in Radians</param>
117         public Degree(Radian value) : this(NDalicPINVOKE.new_Degree__SWIG_2(Radian.getCPtr(value)), true)
118         {
119             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
120         }
121
122         public float Value
123         {
124             set
125             {
126                 NDalicPINVOKE.Degree_degree_set(swigCPtr, value);
127                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128             }
129             get
130             {
131                 float ret = NDalicPINVOKE.Degree_degree_get(swigCPtr);
132                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
133                 return ret;
134             }
135         }
136
137     }
138
139 }