Exemple #1
0
        private void ReportAction(ScheduledTaskChangedEventArgs e)
        {
            switch (e.Action)
            {
            case ScheduledTaskChangedAction.Started:
                Logger.InfoFormat("{0} task scheduled: {1} minutes", e.Key, (int)(e.Interval / Constants.MinToMillisec));
                break;

            case ScheduledTaskChangedAction.Stopped:
                Logger.InfoFormat("{0} task stopped", e.Key);
                break;

            case ScheduledTaskChangedAction.Running:
                Logger.InfoFormat("{0} task running", e.Key);
                break;

            case ScheduledTaskChangedAction.Finished:
                Logger.InfoFormat("{0} task finished: {1:#,##0} ms", e.Key, e.Interval);
                break;

            case ScheduledTaskChangedAction.AlreadyInProgress:
                Logger.WarnFormat("{0} task already in progress", e.Key);
                break;
            }
        }
Exemple #2
0
        private void OnTaskChanged(object s, ScheduledTaskChangedEventArgs e)
        {
            var handler = Changed;

            if (handler != null)
            {
                handler(s, e);
            }
        }