[NUI] Fixing the emtpy finalizers(CA1821)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Radian.cs
1 /*
2  * Copyright(c) 2019 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 using System;
18 using System.ComponentModel;
19
20 namespace Tizen.NUI
21 {
22     /// <summary>
23     /// An angle in radians.
24     /// </summary>
25     /// <since_tizen> 3 </since_tizen>
26     public class Radian : Disposable
27     {
28
29         /// <summary>
30         /// The default constructor, initializes to 0.
31         /// </summary>
32         /// <since_tizen> 3 </since_tizen>
33         public Radian() : this(Interop.Radian.NewRadian(), true)
34         {
35             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
36         }
37
38         /// <summary>
39         /// Creates an angle in radians.
40         /// </summary>
41         /// <param name="value">The initial value in radians.</param>
42         /// <since_tizen> 3 </since_tizen>
43         public Radian(float value) : this(Interop.Radian.NewRadian(value), true)
44         {
45             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
46         }
47
48         /// <summary>
49         /// Creates an angle in radians from an angle in degrees.
50         /// </summary>
51         /// <param name="degree">The initial value in degrees.</param>
52         /// <since_tizen> 3 </since_tizen>
53         public Radian(Degree degree) : this(Interop.Radian.NewRadian(Degree.getCPtr(degree)), true)
54         {
55             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
56         }
57
58         internal Radian(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
59         {
60         }
61
62         /// <summary>
63         /// The value in radians.
64         /// </summary>
65         /// <since_tizen> 3 </since_tizen>
66         public float Value
67         {
68             set
69             {
70                 Interop.Radian.RadianSet(SwigCPtr, value);
71                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
72             }
73             get
74             {
75                 float ret = Interop.Radian.RadianGet(SwigCPtr);
76                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
77                 return ret;
78             }
79         }
80
81         /// <summary>
82         /// Conversion to float.
83         /// </summary>
84         /// <returns>The float value of this radian.</returns>
85         /// <since_tizen> 3 </since_tizen>
86         public float ConvertToFloat()
87         {
88             float ret = Interop.Radian.ConvertToFloat(SwigCPtr);
89             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
90             return ret;
91         }
92
93         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Radian obj)
94         {
95             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
96         }
97
98         /// This will not be public opened.
99         [EditorBrowsable(EditorBrowsableState.Never)]
100         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
101         {
102             Interop.Radian.DeleteRadian(swigCPtr);
103         }
104     }
105 }