public AsyncTimer(Action actionToBePerformed, int ticks, int interval)
 {
     this.Ticks = ticks;
     this.Interval = interval;
     this.args = new ModifiedEventArgs(actionToBePerformed);
     this.timeChanged = new TimeChangedEventHandler(ActionPerformed);
 }
예제 #2
0
        public static void StartAppTimer(TimeChangedEventHandler timeChanged)
        {
            if (appTimer == null)
            {
                var appInterval = Functions.GetConfig("APP_INTERVAL", 300);
                appTimer          = new DispatcherTimer();
                appTimer.Interval = new TimeSpan(0, 0, appInterval); //appInterval Second for display as Clock Counter
                appTimer.Tick    += appTimer_Tick;
                appTimer.Start();
            }

            //Attach the handle
            AppTimeChanged += timeChanged;
        }