[NUI] Fix build warning[CA1064]
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Degree.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 degrees.<br />
24     /// This reduces ambiguity when using methods which accept angles in degrees or radians.<br />
25     /// </summary>
26     /// <since_tizen> 3 </since_tizen>
27     public class Degree : Disposable
28     {
29
30         /// <summary>
31         /// The constructor.
32         /// </summary>
33         /// <since_tizen> 3 </since_tizen>
34         public Degree() : this(Interop.Degree.NewDegree(), true)
35         {
36             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
37         }
38
39         /// <summary>
40         /// Creates an angle in degrees.
41         /// </summary>
42         /// <param name="value">The initial value in degrees.</param>
43         /// <since_tizen> 3 </since_tizen>
44         public Degree(float value) : this(Interop.Degree.NewDegree(value), true)
45         {
46             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
47         }
48
49         /// <summary>
50         /// Creates an angle in degrees from a radian.
51         /// </summary>
52         /// <param name="value">The initial value in radians.</param>
53         /// <since_tizen> 3 </since_tizen>
54         public Degree(Radian value) : this(Interop.Degree.NewDegree(Radian.getCPtr(value)), true)
55         {
56             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
57         }
58
59         internal Degree(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
60         {
61         }
62
63         /// <summary>
64         /// The value of degree.
65         /// </summary>
66         /// <since_tizen> 3 </since_tizen>
67         public float Value
68         {
69             set
70             {
71                 Interop.Degree.DegreeSet(swigCPtr, value);
72                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
73             }
74             get
75             {
76                 float ret = Interop.Degree.DegreeGet(swigCPtr);
77                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
78                 return ret;
79             }
80         }
81
82         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Degree obj)
83         {
84             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
85         }
86
87         /// This will not be public opened.
88         [EditorBrowsable(EditorBrowsableState.Never)]
89         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
90         {
91             Interop.Degree.DeleteDegree(swigCPtr);
92         }
93     }
94 }