public ZoneJob(IServiceProvider container) { this.scope = container.CreateScope(); this.scheduleRepository = scope.ServiceProvider.GetRequiredService <IScheduleRepository>(); this.zoneRepository = scope.ServiceProvider.GetRequiredService <IZoneRepository>(); this.controlService = scope.ServiceProvider.GetRequiredService <IZoneControlService>(); }
public void SetEnablement(IZoneControlService service, bool isEnabled) { if (!isEnabled) { service.Stop(Channel); } this.IsEnabled = isEnabled; }
public ZoneService(IZoneRepository zoneRepository, IZoneControlService controlService) { this.zoneRepository = zoneRepository; this.controlService = controlService; }
public bool IsStarted(IZoneControlService service) { return(service.IsStarted(Channel)); }
public void Stop(IZoneControlService service) { service.Stop(Channel); }
public void SetNewChannel(IZoneControlService service, int newChannel) { service.Stop(Channel); this.Channel = newChannel; }