Support for as keyword instead of DownCast
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Radian.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 radians.
16     /// </summary>
17     public class Radian : global::System.IDisposable
18     {
19         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20         protected bool swigCMemOwn;
21
22         internal Radian(global::System.IntPtr cPtr, bool cMemoryOwn)
23         {
24             swigCMemOwn = cMemoryOwn;
25             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
26         }
27
28         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Radian obj)
29         {
30             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
31         }
32
33         //A Flag to check who called Dispose(). (By User or DisposeQueue)
34         private bool isDisposeQueued = false;
35         //A Flat to check if it is already disposed.
36         protected bool disposed = false;
37
38         ~Radian()
39         {
40             if(!isDisposeQueued)
41             {
42                 isDisposeQueued = true;
43                 DisposeQueue.Instance.Add(this);
44             }
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_Radian(swigCPtr);
90                 }
91                 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
92             }
93             disposed = true;
94         }
95
96
97         /// <summary>
98         /// Default constructor, initializes to 0.
99         /// </summary>
100         public Radian() : this(NDalicPINVOKE.new_Radian__SWIG_0(), true)
101         {
102             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
103         }
104
105         /// <summary>
106         /// Creates an angle in radians.
107         /// </summary>
108         /// <param name="value">The initial value in radians</param>
109         public Radian(float value) : this(NDalicPINVOKE.new_Radian__SWIG_1(value), true)
110         {
111             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
112         }
113
114         /// <summary>
115         /// Creates an angle in radians from an angle in degrees.
116         /// </summary>
117         /// <param name="degree">The initial value in degrees</param>
118         public Radian(Degree degree) : this(NDalicPINVOKE.new_Radian__SWIG_2(Degree.getCPtr(degree)), true)
119         {
120             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121         }
122
123         /// <summary>
124         /// Conversion to float.
125         /// </summary>
126         /// <returns>The float value of this Radian</returns>
127         public float ConvertToFloat()
128         {
129             float ret = NDalicPINVOKE.Radian_ConvertToFloat(swigCPtr);
130             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131             return ret;
132         }
133
134         /// <summary>
135         /// The value in radians
136         /// </summary>
137         public float Value
138         {
139             set
140             {
141                 NDalicPINVOKE.Radian_radian_set(swigCPtr, value);
142                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143             }
144             get
145             {
146                 float ret = NDalicPINVOKE.Radian_radian_get(swigCPtr);
147                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
148                 return ret;
149             }
150         }
151
152     }
153
154 }