public Scheduler(ITimersRepository timersRepository) { _timersRepository = timersRepository; _timersRepository.OnTimerElapsed += _timerExecutionCallback; _schedulerObserversList = new List <IObserver>(); }
public TimersService( IRefereeCodesService refereeCodesService, ITimerEmailsService timerEmailsService, IRouteService routeService, ITimersRepository repository, StripeService stripeService) { _refereeCodesService = refereeCodesService; _repository = repository; _routeService = routeService; _stripeService = stripeService; _timerEmailsService = timerEmailsService; }
public static void Main(string[] args) { _applicationConfiguration = new Configuration(); _applicationConfiguration.Read("appSettings.json"); _timersRepository = new TimersRepository(_applicationConfiguration); _scheduler = new Scheduler(_timersRepository); var serviceActionsHandler = new ServiceActionsHandler(); _scheduler.AttachObserver(serviceActionsHandler); _scheduler.Start(); Console.ReadKey(); _scheduler.DetachObserver(serviceActionsHandler); _scheduler.Stop(); }