Example #1
0
 private void FinishExecute(ScheduleTaskExecuteEventArgs args)
 {
     if (args.IsSuccessed)
     {
         LastExecuteTime = DateTime.Now;
     }
 }
Example #2
0
        private void DoExecute()
        {
            if ((DateTime.Now - LastExecuteTime).TotalMilliseconds * TimeSpan.TicksPerMillisecond < Interval)
            {
                return;
            }
            var args = new ScheduleTaskExecuteEventArgs();

            OnScheduleExecuting?.Invoke(this, args);
            FinishExecute(args);
            if (ScheduleType == ScheduleType.StopOnCondition)
            {
                EvaluateEndCondition();
            }
            else
            {
                if (!Repeatable)
                {
                    IsRunning = false;
                }
            }
            _isExecuting = false;
        }