1 //------------------------------------------------------------------------------
4 // This file was automatically generated by SWIG (http://www.swig.org).
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
15 /// An angle in radians.
17 public class Radian : global::System.IDisposable
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20 protected bool swigCMemOwn;
22 internal Radian(global::System.IntPtr cPtr, bool cMemoryOwn)
24 swigCMemOwn = cMemoryOwn;
25 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
28 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Radian obj)
30 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
33 //NUI Dispose Pattern written by Jinwoo Nam(jjw.nam)
35 //A Flag to check who called Dispose(). (By User or DisposeQueue)
36 private bool isDisposeQueued = false;
37 //A Flat to check if it is already disposed.
38 protected bool disposed = false;
44 isDisposeQueued = true;
45 DisposeQueue.Instance.Add(this);
51 //Throw excpetion if Dispose() is called in separate thread.
52 if (!Window.IsInstalled())
54 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
59 Dispose(DisposeTypes.Implicit);
63 Dispose(DisposeTypes.Explicit);
64 System.GC.SuppressFinalize(this);
68 protected virtual void Dispose(DisposeTypes type)
75 if(type == DisposeTypes.Explicit)
78 //Release your own managed resources here.
79 //You should release all of your own disposable objects here.
82 //Release your own unmanaged resources here.
83 //You should not access any managed member here except static instance.
84 //because the execution order of Finalizes is non-deterministic.
86 if (swigCPtr.Handle != global::System.IntPtr.Zero)
91 NDalicPINVOKE.delete_Radian(swigCPtr);
93 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
100 /// Default constructor, initializes to 0.
102 public Radian() : this(NDalicPINVOKE.new_Radian__SWIG_0(), true)
104 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
108 /// Creates an angle in radians.
110 /// <param name="value">The initial value in radians</param>
111 public Radian(float value) : this(NDalicPINVOKE.new_Radian__SWIG_1(value), true)
113 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
117 /// Creates an angle in radians from an angle in degrees.
119 /// <param name="degree">The initial value in degrees</param>
120 public Radian(Degree degree) : this(NDalicPINVOKE.new_Radian__SWIG_2(Degree.getCPtr(degree)), true)
122 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
126 /// Assigns an angle from a float value.
128 /// <param name="value">Float value in radians</param>
129 /// <returns>A reference to this</returns>
130 internal Radian Assign(float value)
132 Radian ret = new Radian(NDalicPINVOKE.Radian_Assign__SWIG_0(swigCPtr, value), false);
133 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138 /// Assigns an angle from a Degree value.
140 /// <param name="degree">The value in degrees</param>
141 /// <returns>A reference to this</returns>
142 internal Radian Assign(Degree degree)
144 Radian ret = new Radian(NDalicPINVOKE.Radian_Assign__SWIG_1(swigCPtr, Degree.getCPtr(degree)), false);
145 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150 /// Conversion to float.
152 /// <returns>The float value of this Radian</returns>
153 public float ConvertToFloat()
155 float ret = NDalicPINVOKE.Radian_ConvertToFloat(swigCPtr);
156 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161 /// The value in radians
167 NDalicPINVOKE.Radian_radian_set(swigCPtr, value);
168 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
172 float ret = NDalicPINVOKE.Radian_radian_get(swigCPtr);
173 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();