/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* limitations under the License.
*
*/
+using System.ComponentModel;
namespace Tizen.NUI
{
-
/// <summary>
/// An angle in degrees.<br />
/// This reduces ambiguity when using methods which accept angles in degrees or radians.<br />
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public class Degree : global::System.IDisposable
+ public class Degree : Disposable
{
/// <summary>
- /// swigCMemOwn.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- protected bool swigCMemOwn;
-
- /// <summary>
- /// A Flat to check if it is already disposed.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- protected bool disposed = false;
-
- private global::System.Runtime.InteropServices.HandleRef swigCPtr;
-
- //A Flag to check who called Dispose(). (By User or DisposeQueue)
- private bool isDisposeQueued = false;
-
- /// <summary>
/// The constructor.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public Degree() : this(Interop.Degree.new_Degree__SWIG_0(), true)
+ public Degree() : this(Interop.Degree.NewDegree(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// </summary>
/// <param name="value">The initial value in degrees.</param>
/// <since_tizen> 3 </since_tizen>
- public Degree(float value) : this(Interop.Degree.new_Degree__SWIG_1(value), true)
+ public Degree(float value) : this(Interop.Degree.NewDegree(value), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// </summary>
/// <param name="value">The initial value in radians.</param>
/// <since_tizen> 3 </since_tizen>
- public Degree(Radian value) : this(Interop.Degree.new_Degree__SWIG_2(Radian.getCPtr(value)), true)
+ public Degree(Radian value) : this(Interop.Degree.NewDegree(Radian.getCPtr(value)), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal Degree(global::System.IntPtr cPtr, bool cMemoryOwn)
+ internal Degree(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
- swigCMemOwn = cMemoryOwn;
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
- }
-
- /// <summary>
- /// Dispose.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- ~Degree()
- {
- if (!isDisposeQueued)
- {
- isDisposeQueued = true;
- DisposeQueue.Instance.Add(this);
- }
}
/// <summary>
{
set
{
- Interop.Degree.Degree_degree_set(swigCPtr, value);
+ Interop.Degree.DegreeSet(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
- float ret = Interop.Degree.Degree_degree_get(swigCPtr);
+ float ret = Interop.Degree.DegreeGet(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
- /// <summary>
- /// Dispose.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public void Dispose()
- {
- //Throw excpetion if Dispose() is called in separate thread.
- if (!Window.IsInstalled())
- {
- throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
- }
-
- if (isDisposeQueued)
- {
- Dispose(DisposeTypes.Implicit);
- }
- else
- {
- Dispose(DisposeTypes.Explicit);
- System.GC.SuppressFinalize(this);
- }
- }
-
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Degree obj)
{
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
- /// <summary>
- /// Dispose.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- protected virtual void Dispose(DisposeTypes type)
+ /// This will not be public opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
{
- if (disposed)
- {
- return;
- }
-
- if(type == DisposeTypes.Explicit)
- {
- //Called by User
- //Release your own managed resources here.
- //You should release all of your own disposable objects here.
- }
-
- //Release your own unmanaged resources here.
- //You should not access any managed member here except static instance.
- //because the execution order of Finalizes is non-deterministic.
-
- if (swigCPtr.Handle != global::System.IntPtr.Zero)
- {
- if (swigCMemOwn)
- {
- swigCMemOwn = false;
- Interop.Degree.delete_Degree(swigCPtr);
- }
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
- }
- disposed = true;
+ Interop.Degree.DeleteDegree(swigCPtr);
}
-
}
-
-}
\ No newline at end of file
+}