private void ScheduleFinished(object sender, CakeScheduleEventArgs eventArgs) { _serviceLogger.Write("Service run: " + DateTime.Now); if (eventArgs.CakeRescheduleServiceIsRun) { _serviceLogger.Write("Cake Schedule Service run: " + DateTime.Now); } if (eventArgs.MailServiceIsRun) { _serviceLogger.Write("Mail Service run: " + DateTime.Now); } }
private void ScheduleFinished(object sender, CakeScheduleEventArgs eventArgs) { _finishedEventFired = true; _cakeScheduleIsRun = eventArgs.CakeRescheduleServiceIsRun; _mailServiceIsRun = eventArgs.MailServiceIsRun; }
private void Timer_Elapsed(object sender, ElapsedEventArgs args) { bool cakeRescheduleIsRun = RunCakeReschedule(); bool mailServiceIsRun = RunMailService(); if (CakeScheduleFinished != null) { var cakeScheduleEventArgs = new CakeScheduleEventArgs { CakeRescheduleServiceIsRun = cakeRescheduleIsRun, MailServiceIsRun = mailServiceIsRun }; CakeScheduleFinished(this, cakeScheduleEventArgs); } }