public static void CreateAndStart_DispatcherTimer(ref DispatcherTimer timer, DelegateTimerTick TimerTick) { if (timer == null) { timer = new System.Windows.Threading.DispatcherTimer(); } timer.Tick += new EventHandler(TimerTick); timer.Interval = new TimeSpan(0, 0, 0, 0, 20); timer.Start(); }
public static void CreateAndStart_DispatcherTimer(ref DispatcherTimer timer, DelegateTimerTick TimerTick, TimeSpan _Interval) { if (timer == null) { timer = new System.Windows.Threading.DispatcherTimer(); } else { StopAndNull_DispatcherTimer(ref timer); timer = new System.Windows.Threading.DispatcherTimer(); } timer.Tick += new EventHandler(TimerTick); timer.Interval = _Interval; timer.Start(); }
public void Start(DelegateTimerTick TimerTick) { TimeSpan t = new TimeSpan(0, 0, 0, 0, 100); ToolsClass.CreateAndStart_DispatcherTimer(ref timer, TimerTick, t); }