* limitations under the License.
*
*/
-// This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
-//------------------------------------------------------------------------------
-// <auto-generated />
-//
-// This file was automatically generated by SWIG (http://www.swig.org).
-// Version 3.0.9
-//
-// Do not make changes to this file unless you know what you are doing--modify
-// the SWIG interface file instead.
-//------------------------------------------------------------------------------
namespace Tizen.NUI.UIComponents
{
using System;
using System.Runtime.InteropServices;
using Tizen.NUI.BaseComponents;
-
+
/// <summary>
/// Slider is a control to enable sliding an indicator between two values.
/// </summary>
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
- ~Slider()
- {
- DisposeQueue.Instance.Add(this);
- }
-
/// <summary>
/// Dispose
/// </summary>
- public override void Dispose()
+ protected override void Dispose(DisposeTypes type)
{
- if (!Stage.IsInstalled())
+ if (disposed)
{
- DisposeQueue.Instance.Add(this);
return;
}
- lock (this)
+ if (type == DisposeTypes.Explicit)
{
- if (swigCPtr.Handle != global::System.IntPtr.Zero)
+ //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 (_sliderValueChangedCallbackDelegate != null)
+ {
+ ValueChangedSignal().Disconnect(_sliderValueChangedCallbackDelegate);
+ }
+
+ if (_sliderSlidingFinishedCallbackDelegate != null)
+ {
+ SlidingFinishedSignal().Disconnect(_sliderSlidingFinishedCallbackDelegate);
+ }
+
+ if (_sliderMarkReachedCallbackDelegate != null)
+ {
+ MarkReachedSignal().Disconnect(_sliderMarkReachedCallbackDelegate);
+ }
+
+ if (swigCPtr.Handle != global::System.IntPtr.Zero)
+ {
+ if (swigCMemOwn)
{
- if (swigCMemOwn)
- {
- swigCMemOwn = false;
- NDalicPINVOKE.delete_Slider(swigCPtr);
- }
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ swigCMemOwn = false;
+ NDalicPINVOKE.delete_Slider(swigCPtr);
}
- global::System.GC.SuppressFinalize(this);
- base.Dispose();
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
- }
-
+ base.Dispose(type);
+ }
/// <summary>
/// Value changed event arguments.
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
+ //A Flag to check who called Dispose(). (By User or DisposeQueue)
+ private bool isDisposeQueued = false;
+ //A Flat to check if it is already disposed.
+ protected bool disposed = false;
+
~Property()
{
- Dispose();
+ if (!isDisposeQueued)
+ {
+ isDisposeQueued = true;
+ DisposeQueue.Instance.Add(this);
+ }
+ }
+
+ 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);
+ }
}
- public virtual void Dispose()
+ protected virtual void Dispose(DisposeTypes type)
{
- lock (this)
+ 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 (swigCPtr.Handle != global::System.IntPtr.Zero)
+ if (swigCMemOwn)
{
- if (swigCMemOwn)
- {
- swigCMemOwn = false;
- NDalicPINVOKE.delete_Slider_Property(swigCPtr);
- }
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ swigCMemOwn = false;
+ NDalicPINVOKE.delete_Slider_Property(swigCPtr);
}
- global::System.GC.SuppressFinalize(this);
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
+
+ disposed = true;
}
internal Property() : this(NDalicPINVOKE.new_Slider_Property(), true)
/// <returns>Handle to a Slider or an uninitialized handle</returns>
public new static Slider DownCast(BaseHandle handle)
{
- Slider ret = new Slider(NDalicPINVOKE.Slider_DownCast(BaseHandle.getCPtr(handle)), true);
+ Slider ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Slider;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
return ret;
}
- internal enum PropertyRange
- {
- PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
- PROPERTY_END_INDEX = View.PropertyRange.PROPERTY_START_INDEX + 1000
- }
-
/// <summary>
/// Lower bound property
/// </summary>
get
{
float temp = 0.0f;
- GetProperty(Slider.Property.LOWER_BOUND).Get(ref temp);
+ GetProperty(Slider.Property.LOWER_BOUND).Get(out temp);
return temp;
}
set
get
{
float temp = 0.0f;
- GetProperty(Slider.Property.UPPER_BOUND).Get(ref temp);
+ GetProperty(Slider.Property.UPPER_BOUND).Get(out temp);
return temp;
}
set
get
{
float temp = 0.0f;
- GetProperty(Slider.Property.VALUE).Get(ref temp);
+ GetProperty(Slider.Property.VALUE).Get(out temp);
return temp;
}
set
get
{
int temp = 0;
- GetProperty(Slider.Property.VALUE_PRECISION).Get(ref temp);
+ GetProperty(Slider.Property.VALUE_PRECISION).Get(out temp);
return temp;
}
set
get
{
bool temp = false;
- GetProperty(Slider.Property.SHOW_POPUP).Get(ref temp);
+ GetProperty(Slider.Property.SHOW_POPUP).Get(out temp);
return temp;
}
set
get
{
bool temp = false;
- GetProperty(Slider.Property.SHOW_VALUE).Get(ref temp);
+ GetProperty(Slider.Property.SHOW_VALUE).Get(out temp);
return temp;
}
set
get
{
bool temp = false;
- GetProperty(Slider.Property.SNAP_TO_MARKS).Get(ref temp);
+ GetProperty(Slider.Property.SNAP_TO_MARKS).Get(out temp);
return temp;
}
set
get
{
float temp = 0.0f;
- GetProperty(Slider.Property.MARK_TOLERANCE).Get(ref temp);
+ GetProperty(Slider.Property.MARK_TOLERANCE).Get(out temp);
return temp;
}
set