/// <since_tizen> 4 </since_tizen>
public class WatchTime : global::System.IDisposable
{
- private global::System.Runtime.InteropServices.HandleRef swigCPtr;
-
/// <summary>
/// swigCMemOwn.
/// </summary>
/// <since_tizen> 4 </since_tizen>
protected bool swigCMemOwn;
- internal WatchTime(global::System.IntPtr cPtr, bool cMemoryOwn)
- {
- swigCMemOwn = cMemoryOwn;
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
- }
-
- internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WatchTime obj)
- {
- 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;
-
/// <summary>
/// A Flat to check if it is already disposed.
/// </summary>
/// <since_tizen> 4 </since_tizen>
protected bool disposed = false;
- /// <summary>
- /// Distructor.
- /// </summary>
- ~WatchTime()
- {
- if (!isDisposeQueued)
- {
- isDisposeQueued = true;
- DisposeQueue.Instance.Add(this);
- }
- }
-
- /// <summary>
- /// To make watch time instance be disposed.
- /// </summary>
- /// <since_tizen> 4 </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);
- }
- }
+ private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+ //A Flag to check who called Dispose(). (By User or DisposeQueue)
+ private bool isDisposeQueued = false;
/// <summary>
- /// you can override it to clean-up your own resources.
+ /// Constructor.
/// </summary>
- /// <param name="type">DisposeTypes</param>
/// <since_tizen> 4 </since_tizen>
- protected virtual void Dispose(DisposeTypes type)
+ public WatchTime() : this(NDalicManualPINVOKE.new_WatchTime(), true)
{
- 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;
- NDalicManualPINVOKE.delete_WatchTime(swigCPtr);
- }
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
- }
-
- disposed = true;
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal static WatchTime GetWatchTimeFromPtr(global::System.IntPtr cPtr)
+ internal WatchTime(global::System.IntPtr cPtr, bool cMemoryOwn)
{
- WatchTime ret = new WatchTime(cPtr, false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ swigCMemOwn = cMemoryOwn;
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
/// <summary>
- /// Constructor.
+ /// Distructor.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
- public WatchTime() : this(NDalicManualPINVOKE.new_WatchTime(), true)
+ ~WatchTime()
{
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ if (!isDisposeQueued)
+ {
+ isDisposeQueued = true;
+ DisposeQueue.Instance.Add(this);
+ }
}
/// <summary>
}
}
- internal int GetHour()
- {
- int ret = NDalicManualPINVOKE.WatchTime_GetHour(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
/// <summary>
/// Get the current hour24.
/// </summary>
}
}
- internal int GetHour24()
- {
- int ret = NDalicManualPINVOKE.WatchTime_GetHour24(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
/// <summary>
/// Get the current minute.
/// </summary>
}
}
- internal int GetMinute()
- {
- int ret = NDalicManualPINVOKE.WatchTime_GetMinute(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
/// <summary>
/// Get the current second.
/// </summary>
}
}
- internal int GetSecond()
- {
- int ret = NDalicManualPINVOKE.WatchTime_GetSecond(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
/// <summary>
/// Get the current millisecond.
/// </summary>
}
}
- internal int GetMillisecond()
- {
- int ret = NDalicManualPINVOKE.WatchTime_GetMillisecond(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
/// <summary>
/// Get the current year.
/// </summary>
}
}
- internal int GetYear()
- {
- int ret = NDalicManualPINVOKE.WatchTime_GetYear(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
/// <summary>
/// Get the current month.
/// </summary>
}
}
- internal int GetMonth()
- {
- int ret = NDalicManualPINVOKE.WatchTime_GetMonth(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
/// <summary>
/// Get the current day.
/// </summary>
}
}
- internal int GetDay()
- {
- int ret = NDalicManualPINVOKE.WatchTime_GetDay(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
/// <summary>
/// Get the current week.
/// </summary>
}
}
- internal int GetDayOfWeek()
- {
- int ret = NDalicManualPINVOKE.WatchTime_GetDayOfWeek(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- internal SWIGTYPE_p_tm GetUtcTime()
- {
- SWIGTYPE_p_tm ret = new SWIGTYPE_p_tm(NDalicManualPINVOKE.WatchTime_GetUtcTime(swigCPtr), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- internal SWIGTYPE_p_time_t GetUtcTimeStamp()
- {
- SWIGTYPE_p_time_t ret = new SWIGTYPE_p_time_t(NDalicManualPINVOKE.WatchTime_GetUtcTimeStamp(swigCPtr), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
/// <summary>
/// Get the ID of timezone.
/// </summary>
}
}
- internal string GetTimeZone()
- {
- string ret = NDalicManualPINVOKE.WatchTime_GetTimeZone(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
/// <summary>
/// Get the daylight saving time status.
/// </summary>
}
}
+ /// <summary>
+ /// To make watch time instance be disposed.
+ /// </summary>
+ /// <since_tizen> 4 </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(WatchTime obj)
+ {
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+ }
+
+ internal static WatchTime GetWatchTimeFromPtr(global::System.IntPtr cPtr)
+ {
+ WatchTime ret = new WatchTime(cPtr, false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal int GetDayOfWeek()
+ {
+ int ret = NDalicManualPINVOKE.WatchTime_GetDayOfWeek(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal SWIGTYPE_p_tm GetUtcTime()
+ {
+ SWIGTYPE_p_tm ret = new SWIGTYPE_p_tm(NDalicManualPINVOKE.WatchTime_GetUtcTime(swigCPtr), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal SWIGTYPE_p_time_t GetUtcTimeStamp()
+ {
+ SWIGTYPE_p_time_t ret = new SWIGTYPE_p_time_t(NDalicManualPINVOKE.WatchTime_GetUtcTimeStamp(swigCPtr), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal string GetTimeZone()
+ {
+ string ret = NDalicManualPINVOKE.WatchTime_GetTimeZone(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
internal bool GetDaylightSavingTimeStatus()
{
bool ret = NDalicManualPINVOKE.WatchTime_GetDaylightSavingTimeStatus(swigCPtr);
return ret;
}
+ internal int GetHour()
+ {
+ int ret = NDalicManualPINVOKE.WatchTime_GetHour(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal int GetHour24()
+ {
+ int ret = NDalicManualPINVOKE.WatchTime_GetHour24(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal int GetMinute()
+ {
+ int ret = NDalicManualPINVOKE.WatchTime_GetMinute(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal int GetSecond()
+ {
+ int ret = NDalicManualPINVOKE.WatchTime_GetSecond(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal int GetMillisecond()
+ {
+ int ret = NDalicManualPINVOKE.WatchTime_GetMillisecond(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal int GetYear()
+ {
+ int ret = NDalicManualPINVOKE.WatchTime_GetYear(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal int GetMonth()
+ {
+ int ret = NDalicManualPINVOKE.WatchTime_GetMonth(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal int GetDay()
+ {
+ int ret = NDalicManualPINVOKE.WatchTime_GetDay(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ /// <summary>
+ /// you can override it to clean-up your own resources.
+ /// </summary>
+ /// <param name="type">DisposeTypes</param>
+ /// <since_tizen> 4 </since_tizen>
+ protected virtual void Dispose(DisposeTypes type)
+ {
+ 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;
+ NDalicManualPINVOKE.delete_WatchTime(swigCPtr);
+ }
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+
+ disposed = true;
+ }
+
}
}