using System;
using System.Runtime.InteropServices;
using System.ComponentModel;
+using System.Threading;
namespace Tizen.NUI
{
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+ private bool played = false;
+ private string stackTrace;
+
internal Timer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Timer_SWIGUpcast(cPtr), cMemoryOwn)
{
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
+ played = false;
base.Dispose(type);
}
{
if (_timerTickEventHandler == null)
{
- _timerTickCallbackDelegate = (OnTick);
+ _timerTickCallbackDelegate = new TickCallbackDelegate(OnTick);
TickSignal().Connect(_timerTickCallbackDelegate);
}
_timerTickEventHandler += value;
{
TickEventArgs e = new TickEventArgs();
- if (_timerTickEventHandler != null)
+ if (played == false)
+ {
+ Tizen.Log.Fatal("NUI", $"should not be here! OnTick()!swigCPtr={swigCPtr.Handle}");
+ Tizen.Log.Fatal("NUI", "should not be here! #################### TID = " + global::System.Threading.Thread.CurrentThread.ManagedThreadId);
+ Tizen.Log.Fatal("NUI", stackTrace);
+ }
+
+ if (_timerTickEventHandler != null && played == true)
{
//here we send all data to user event handlers
return _timerTickEventHandler(this, e);
/// <since_tizen> 3 </since_tizen>
public Timer(uint milliSec) : this(NDalicPINVOKE.Timer_New(milliSec), true)
{
+ stackTrace = Environment.StackTrace;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public void Start()
{
+ played = true;
NDalicPINVOKE.Timer_Start(swigCPtr);
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public void Stop()
{
+ played = false;
NDalicPINVOKE.Timer_Stop(swigCPtr);
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
-}
\ No newline at end of file
+}
+