Example #1
0
        private void _timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            _timer.Stop();

            //explorer 进程已死
            if (_exploreProcess == null || _exploreProcess.HasExited)
            {
                _workerw        = IntPtr.Zero;
                _exploreProcess = GetExplorer();
            }

            //重新应用壁纸
            if (Shown && _exploreProcess != null && _workerw == IntPtr.Zero)
            {
                InnerInit();
                _workerw = GetWorkerW();
                Shown    = false;
                NeedReapply?.Invoke(this, new EventArgs());
            }

            TimerElapsed?.Invoke(this, new EventArgs());

            if (_timer == null)
            {
                return;//disposed
            }
            _timer.Start();
        }
        protected virtual void OnTimerElapsed()
        {
            _logger.Info($"New log file creation procedure event fired.");

            TimerElapsed?.Invoke(this, new EventArgs {
            });
        }
Example #3
0
 private async Task OnTimerElapsed()
 {
     if (TimerElapsed is not null)
     {
         await TimerElapsed.Invoke(this);
     }
 }
Example #4
0
 public void Start(double interval)
 {
     _timer          = new System.Timers.Timer(interval);
     _timer.Elapsed += (object sender, ElapsedEventArgs e) =>
     {
         _avevaDispatcher.BeginInvoke(new Action(() => TimerElapsed?.Invoke(new ArrayList())));
     };
     _timer.Start();
 }
Example #5
0
 private void Timer_Elapsed(object sender, ElapsedEventArgs e)
 {
     if (Seconds <= 0)
     {
         Timer.Stop();
         return;
     }
     Seconds--;
     TimerElapsed?.Invoke(this, e);
 }
        private void Timer_Elapsed(object state)
        {
            _progressValue += 1;
            if (_progressValue >= 100)
            {
                _progressValue = 100;
            }

            TimerElapsed?.Invoke(_progressValue);
        }
Example #7
0
 public Error(string message, int timerSeconds)
 {
     Message        = message;
     timer          = new Timer(timerSeconds * 1000);
     timer.Elapsed += (sender, e) =>
     {
         TimerElapsed?.Invoke(this, e);
         timer.Stop();
     };
     timer.Start();
 }
        public void StartTimer()
        {
            var timer = new Timer(Interval);

            timer.AutoReset = true;
            timer.Elapsed  += (s, e) =>
            {
                Current = Current.AddMilliseconds(Interval * Factor);
                TimerElapsed?.Invoke();
            };
            timer.Start();
        }
Example #9
0
        private void Update()
        {
            if (CurrentDuration <= 0f)
            {
                return;
            }

            Timer += Time.deltaTime;

            float timeLeft = CurrentDuration - Timer;

            ShowText(timeLeft.ToString("0.00") + " Seconds Remaining");

            if (Timer >= CurrentDuration)
            {
                TimerElapsed?.Invoke();
                Timer           = 0f;
                CurrentDuration = 0;
                Hide();
            }
        }
 private void OnTimerElapsed(object sender)
 {
     TimerElapsed?.Invoke(this, new TimerEventArgs(_random.Next(0, 100)));
 }
 private void RaiseTimerElapsed(int tick)
 {
     TimerElapsed?.Invoke(this, tick);
 }
Example #12
0
 private void OnTimerCallback()
 {
     TimerElapsed?.Invoke();
 }
Example #13
0
 public static void RaiseTimerElapsed()
 {
     TimerElapsed?.Invoke(typeof(ProgressBarManager), EventArgs.Empty);
 }
Example #14
0
 protected void RaiseTimerElapsedEvent()
 {
     TimerElapsed?.Invoke(this, new TimerEventArgs(ID, ScheduleType, RequestGroupList));
 }
 /// <summary>
 /// Called when [elapsed].
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="eventArgs">The event arguments.</param>
 private void OnElapsed(object sender, TimerElapsedEvenArgs eventArgs)
 {
     TimerElapsed?.Invoke(this, eventArgs);
 }
Example #16
0
 protected internal override void OnTimerElapsedHandler(object sender, ElapsedEventArgs e)
 {
     TimerElapsed?.Invoke();
 }