public TurnOnAndOffAutomation(AutomationId id, IDateTimeService dateTimeService, ISchedulerService schedulerService, ISettingsService settingsService, IDaylightService daylightService)
            : base(id)
        {
            if (dateTimeService == null)
            {
                throw new ArgumentNullException(nameof(dateTimeService));
            }
            if (schedulerService == null)
            {
                throw new ArgumentNullException(nameof(schedulerService));
            }
            if (settingsService == null)
            {
                throw new ArgumentNullException(nameof(settingsService));
            }
            if (daylightService == null)
            {
                throw new ArgumentNullException(nameof(daylightService));
            }

            _dateTimeService  = dateTimeService;
            _schedulerService = schedulerService;
            _daylightService  = daylightService;

            settingsService.CreateSettingsMonitor <TurnOnAndOffAutomationSettings>(Id, s => Settings = s);
        }
Exemple #2
0
        public static string GetLogoPath(ISchedulerService tvSchedulerAgent, Guid channelId, string channelDisplayName, int width, int height)
        {
            string cachePath = Path.Combine(_cacheBasePath, width.ToString(CultureInfo.InvariantCulture) + "x" + height.ToString(CultureInfo.InvariantCulture));

            Directory.CreateDirectory(cachePath);

            string logoImagePath = Path.Combine(cachePath, MakeValidFileName(channelDisplayName) + ".png");

            DateTime modifiedDateTime = DateTime.MinValue;

            if (File.Exists(logoImagePath))
            {
                modifiedDateTime = File.GetLastWriteTime(logoImagePath);
            }

            byte[] imageBytes = tvSchedulerAgent.GetChannelLogo(channelId, width, height, true, modifiedDateTime);
            if (imageBytes == null)
            {
                if (File.Exists(logoImagePath))
                {
                    File.Delete(logoImagePath);
                }
            }
            else if (imageBytes.Length > 0)
            {
                using (FileStream imageStream = new FileStream(logoImagePath, FileMode.Create))
                {
                    imageStream.Write(imageBytes, 0, imageBytes.Length);
                    imageStream.Close();
                }
            }

            return(File.Exists(logoImagePath) ? logoImagePath : null);
        }
 public InitializationService(DefaultContext dbContext, IConfiguration configuration, IProviderModelService providerModelService, ISchedulerService schedulerService)
 {
     this.dbContext            = dbContext;
     this.configuration        = configuration;
     this.providerModelService = providerModelService;
     this.schedulerService     = schedulerService;
 }
 public SchedulerServiceTests()
 {
     service = new SchedulerService(
         new Mock <MikiApp>().Object,
         new InMemoryCacheClient(new ProtobufSerializer()),
         null);
 }
Exemple #5
0
        }                                             // I give up.

        public Provider(
            IAuthorizationService authorization,
            ILoggingService log,
            IControlService control,
            IDataService data,
            IBillingService billing,
            IInventoryService inventory,
            IOrderingService ordering,
            IStoreService store,
            IMailService mail,
            IPhysicalAccessService physicalAccess,
            ISchedulerService scheduler,
            IFeedbackService feedback,
            IReportingService reporting,
            IWorkerService worker,
            IProviderUtility utility,
            IDataAccessService dataAccess)
        {
            Authorization  = authorization;
            Log            = log;
            Control        = control;
            Data           = data;
            Billing        = billing;
            Inventory      = inventory;
            Ordering       = ordering;
            Store          = store;
            Mail           = mail;
            PhysicalAccess = physicalAccess;
            Scheduler      = scheduler;
            Feedback       = feedback;
            Reporting      = reporting;
            Worker         = worker;
            Utility        = utility;
            DataAccess     = dataAccess;
        }
        public RollerShutter(
            ComponentId id, 
            IRollerShutterEndpoint endpoint,
            ITimerService timerService,
            ISchedulerService schedulerService,
            ISettingsService settingsService)
            : base(id)
        {
            if (id == null) throw new ArgumentNullException(nameof(id));
            if (endpoint == null) throw new ArgumentNullException(nameof(endpoint));
            if (schedulerService == null) throw new ArgumentNullException(nameof(schedulerService));
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));

            _endpoint = endpoint;
            _schedulerService = schedulerService;

            settingsService.CreateSettingsMonitor<RollerShutterSettings>(Id, s => Settings = s);

            timerService.Tick += (s, e) => UpdatePosition(e);

            _startMoveUpAction = new Action(() => SetState(RollerShutterStateId.MovingUp));
            _turnOffAction = new Action(() => SetState(RollerShutterStateId.Off));
            _startMoveDownAction = new Action(() => SetState(RollerShutterStateId.MovingDown));

            endpoint.Stop(HardwareParameter.ForceUpdateState);
        }
        public NotificationService(
            IDateTimeService dateTimeService, 
            IApiService apiService, 
            ISchedulerService schedulerService, 
            ISettingsService settingsService,
            IStorageService storageService,
            IResourceService resourceService)
        {
            if (dateTimeService == null) throw new ArgumentNullException(nameof(dateTimeService));
            if (apiService == null) throw new ArgumentNullException(nameof(apiService));
            if (schedulerService == null) throw new ArgumentNullException(nameof(schedulerService));
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));
            if (storageService == null) throw new ArgumentNullException(nameof(storageService));
            if (resourceService == null) throw new ArgumentNullException(nameof(resourceService));

            _dateTimeService = dateTimeService;
            _storageService = storageService;
            _resourceService = resourceService;

            settingsService.CreateSettingsMonitor<NotificationServiceSettings>(s => Settings = s);

            apiService.StatusRequested += HandleApiStatusRequest;

            schedulerService.RegisterSchedule("NotificationCleanup", TimeSpan.FromMinutes(15), Cleanup);
        }
Exemple #8
0
        public RollerShutter(
            ComponentId id,
            IRollerShutterEndpoint endpoint,
            IHomeAutomationTimer timer,
            ISchedulerService schedulerService)
            : base(id)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id));
            }
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }
            if (schedulerService == null)
            {
                throw new ArgumentNullException(nameof(schedulerService));
            }

            _endpoint         = endpoint;
            _timer            = timer;
            _schedulerService = schedulerService;

            timer.Tick += (s, e) => UpdatePosition(e);
            _settings   = new RollerShutterSettingsWrapper(Settings);

            _startMoveUpAction   = new Action(() => SetState(RollerShutterStateId.MovingUp));
            _turnOffAction       = new Action(() => SetState(RollerShutterStateId.Off));
            _startMoveDownAction = new Action(() => SetState(RollerShutterStateId.MovingDown));

            endpoint.Stop(HardwareParameter.ForceUpdateState);
        }
 public void RefreshEpgData(ISchedulerService tvSchedulerAgent, IGuideService tvGuideAgent,
                            IControlService tvControlAgent, bool reloadData, Guid currentChannelGroupId, DateTime guideDateTime,
                            CancellationPendingDelegate cancellationPending)
 {
     if (reloadData)
     {
         _model.ProgramsByChannel.Clear();
         RefreshUpcomingPrograms(tvSchedulerAgent, tvControlAgent);
         if (cancellationPending != null &&
             cancellationPending())
         {
             return;
         }
     }
     if (guideDateTime != DateTime.MinValue)
     {
         SetChannelGroup(currentChannelGroupId);
         _model.GuideDateTime = guideDateTime;
         _model.Channels      = new List <Channel>(tvSchedulerAgent.GetChannelsInGroup(currentChannelGroupId, true));
         if (cancellationPending != null &&
             cancellationPending())
         {
             return;
         }
         RefreshChannelsEpgData(tvGuideAgent, _model.Channels, guideDateTime, guideDateTime.AddDays(1), cancellationPending);
     }
     else
     {
         _model.Channels = new List <Channel>();
     }
 }
Exemple #10
0
        public void Config()
        {
            try
            {
                CodeSharp.Core.Configuration.ConfigWithEmbeddedXml(null
                    , "application_config"
                    , Assembly.GetExecutingAssembly()
                    , "Taobao.Workflow.Activities.Test.ConfigFiles")
                    .RenderProperties()
                    .Castle(o => this.Resolve(o.Container));
                //设置容器
                Taobao.Activities.ActivityUtilities.Container(new Taobao.Workflow.Activities.Application.Container());
                Taobao.Activities.Hosting.WorkflowInstance.IsEnableDebug = false;
            }
            catch (InvalidOperationException e)
            {
                if (!e.Message.Contains("不可重复初始化配置"))
                    Console.WriteLine(e.Message);
            }

            this._log = DependencyResolver.Resolve<ILoggerFactory>().Create(this.GetType());
            this._userService = DependencyResolver.Resolve<IUserService>();
            this._processService = DependencyResolver.Resolve<IProcessService>();
            this._processTypeService = DependencyResolver.Resolve<IProcessTypeService>();
            this._workItemService = DependencyResolver.Resolve<IWorkItemService>();
            this._timeZoneService = DependencyResolver.Resolve<ITimeZoneService>();
            this._resumptionService = DependencyResolver.Resolve<ISchedulerService>();
            this._scheduler = DependencyResolver.Resolve<IScheduler>();
            this._sessionManager = DependencyResolver.Resolve<Castle.Facilities.NHibernateIntegration.ISessionManager>();
            this._managementApi = DependencyResolver.Resolve<Taobao.Workflow.Activities.Management.ITFlowEngine>();
            this._clientApi = DependencyResolver.Resolve<Taobao.Workflow.Activities.Client.ITFlowEngine>();
        }
Exemple #11
0
        public WeatherComponent(ISchedulerService jobSchedulerService, ILogger <WeatherComponent> logger, IIoTService ioTService)
        {
            _logger           = logger;
            _schedulerService = jobSchedulerService;

            _ioTService = ioTService;
        }
Exemple #12
0
        public RemoteSocketService(
            IConfigurationService configurationService,
            IDeviceRegistryService deviceRegistryService,
            ISchedulerService schedulerService,
            ISystemInformationService systemInformationService,
            ILogService logService)
        {
            _configurationService  = configurationService ?? throw new ArgumentNullException(nameof(configurationService));
            _deviceRegistryService = deviceRegistryService ?? throw new ArgumentNullException(nameof(deviceRegistryService));
            if (schedulerService == null)
            {
                throw new ArgumentNullException(nameof(schedulerService));
            }
            _systemInformationService = systemInformationService ?? throw new ArgumentNullException(nameof(systemInformationService));
            if (logService == null)
            {
                throw new ArgumentNullException(nameof(logService));
            }

            // Ensure that the state of the remote switch is restored if the original remote is used
            // or the switch has been removed from the socket and plugged in at another place.
            schedulerService.Register("RCSocketStateSender", TimeSpan.FromMinutes(1), () => RefreshStates());

            _log = logService.CreatePublisher(nameof(RemoteSocketService));
        }
        public AutomationFactory(
            ISchedulerService schedulerService,
            INotificationService notificationService,
            IDateTimeService dateTimeService,
            IDaylightService daylightService,
            IOutdoorTemperatureService outdoorTemperatureService,
            IComponentService componentService,
            ISettingsService settingsService,
            IResourceService resourceService)
        {
            if (schedulerService == null) throw new ArgumentNullException(nameof(schedulerService));
            if (notificationService == null) throw new ArgumentNullException(nameof(notificationService));
            if (dateTimeService == null) throw new ArgumentNullException(nameof(dateTimeService));
            if (daylightService == null) throw new ArgumentNullException(nameof(daylightService));
            if (outdoorTemperatureService == null) throw new ArgumentNullException(nameof(outdoorTemperatureService));
            if (componentService == null) throw new ArgumentNullException(nameof(componentService));
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));
            if (resourceService == null) throw new ArgumentNullException(nameof(resourceService));

            _schedulerService = schedulerService;
            _notificationService = notificationService;
            _dateTimeService = dateTimeService;
            _daylightService = daylightService;
            _outdoorTemperatureService = outdoorTemperatureService;
            _componentService = componentService;
            _settingsService = settingsService;
            _resourceService = resourceService;
        }
 public ExerciseProgramViewModelBuilder()
 {
     this.loggerService = new LoggerServiceMock(MockBehavior.Loose);
     this.schedulerService = new SchedulerServiceMock(MockBehavior.Loose);
     this.hostScreen = new ScreenMock(MockBehavior.Loose);
     this.model = new ExerciseProgramBuilder();
 }
        public LowerBathroomConfiguration(
            IDeviceService deviceService,
            ISchedulerService schedulerService,
            IAreaService areaService,
            SynonymService synonymService,
            AutomationFactory automationFactory,
            ActuatorFactory actuatorFactory,
            SensorFactory sensorFactory)
        {
            if (deviceService == null) throw new ArgumentNullException(nameof(deviceService));
            if (schedulerService == null) throw new ArgumentNullException(nameof(schedulerService));
            if (areaService == null) throw new ArgumentNullException(nameof(areaService));
            if (synonymService == null) throw new ArgumentNullException(nameof(synonymService));
            if (automationFactory == null) throw new ArgumentNullException(nameof(automationFactory));
            if (actuatorFactory == null) throw new ArgumentNullException(nameof(actuatorFactory));
            if (sensorFactory == null) throw new ArgumentNullException(nameof(sensorFactory));

            _deviceService = deviceService;
            _schedulerService = schedulerService;
            _areaService = areaService;
            _synonymService = synonymService;
            _automationFactory = automationFactory;
            _actuatorFactory = actuatorFactory;
            _sensorFactory = sensorFactory;
        }
Exemple #16
0
 public void Initialize(ISchedulerService tvSchedulerAgent, ChannelType channelType, int epgHours, int epgHoursOffset, string allChannelsGroupName)
 {
     _model.EpgHours             = epgHours;
     _model.EpgHoursOffset       = epgHoursOffset;
     _model.AllChannelsGroupName = allChannelsGroupName;
     ChangeChannelType(tvSchedulerAgent, channelType);
 }
Exemple #17
0
        public NotificationService(
            IDateTimeService dateTimeService,
            IApiDispatcherService apiService,
            ISchedulerService schedulerService,
            ISettingsService settingsService,
            IStorageService storageService,
            IResourceService resourceService,
            ILogService logService)
        {
            if (apiService == null)
            {
                throw new ArgumentNullException(nameof(apiService));
            }
            if (schedulerService == null)
            {
                throw new ArgumentNullException(nameof(schedulerService));
            }
            if (settingsService == null)
            {
                throw new ArgumentNullException(nameof(settingsService));
            }

            _dateTimeService = dateTimeService ?? throw new ArgumentNullException(nameof(dateTimeService));
            _storageService  = storageService ?? throw new ArgumentNullException(nameof(storageService));
            _resourceService = resourceService ?? throw new ArgumentNullException(nameof(resourceService));

            _log = logService.CreatePublisher(nameof(NotificationService));
            settingsService.CreateSettingsMonitor <NotificationServiceSettings>(s => Settings = s.NewSettings);

            apiService.StatusRequested += HandleApiStatusRequest;

            schedulerService.RegisterSchedule("NotificationCleanup", TimeSpan.FromMinutes(15), () => Cleanup());
        }
Exemple #18
0
        public void ChangeChannelType(ISchedulerService tvSchedulerAgent, ChannelType channelType)
        {
            _model.ChannelType = channelType;
            _model.ChannelGroups.Clear();
            _model.ChannelGroups.AddRange(tvSchedulerAgent.GetAllChannelGroups(channelType, true));
            _model.ChannelGroups.Add(new ChannelGroup()
            {
                ChannelGroupId = channelType == ChannelType.Television ? ChannelGroup.AllTvChannelsGroupId : ChannelGroup.AllRadioChannelsGroupId,
                ChannelType    = channelType,
                GroupName      = _model.AllChannelsGroupName,
                VisibleInGuide = true
            });

            if (_model.GuideDateTime == DateTime.MinValue)
            {
                GotoNow();
                _model.CurrentChannelGroupId = _model.ChannelGroups[0].ChannelGroupId;
            }
            else
            {
                bool currentIsOk = false;
                foreach (ChannelGroup channelGroup in _model.ChannelGroups)
                {
                    if (channelGroup.ChannelGroupId == _model.CurrentChannelGroupId)
                    {
                        currentIsOk = true;
                        break;
                    }
                }
                if (!currentIsOk)
                {
                    _model.CurrentChannelGroupId = _model.ChannelGroups[0].ChannelGroupId;
                }
            }
        }
Exemple #19
0
        public MotionDetector(string id, IMotionDetectorAdapter adapter, ISchedulerService schedulerService, ISettingsService settingsService, IMessageBrokerService messageBroker)
            : base(id)
        {
            if (adapter == null)
            {
                throw new ArgumentNullException(nameof(adapter));
            }
            _messageBroker = messageBroker ?? throw new ArgumentNullException(nameof(messageBroker));

            _settingsService  = settingsService ?? throw new ArgumentNullException(nameof(settingsService));
            _schedulerService = schedulerService ?? throw new ArgumentNullException(nameof(schedulerService));

            adapter.StateChanged += UpdateState;

            settingsService.CreateSettingsMonitor <MotionDetectorSettings>(this, s =>
            {
                Settings = s.NewSettings;

                if (s.OldSettings != null && s.OldSettings.IsEnabled != s.NewSettings.IsEnabled)
                {
                    HandleIsEnabledStateChanged();
                }
            });

            _commandExecutor.Register <ResetCommand>(c => adapter.Refresh());
        }
        public string Schedule()
        {
            if (_messageJson == null)
            {
                throw new ArgumentException("The message must be set");
            }
            if (_channelName == null)
            {
                throw new ArgumentException("The channelname must be set.");
            }

            using (ChannelFactory <ISchedulerService> ch = new ChannelFactory <ISchedulerService>(ClientUtilManager.Ask().EndpointConfigurationName))
            {
                ISchedulerService svc = ch.CreateChannel();

                if (!string.IsNullOrEmpty(_CRONString))
                {
                    return(svc.CRONChannelMessage(_channelName, _broadcast, _messageJson, _CRONString, _timeLimit, _fireAndForget));
                }
                else
                {
                    return(svc.PeriodicChannelMessage(_channelName, _broadcast, _messageJson, _delay, _period, _timeLimit, _fireAndForget));
                }
            }
        }
        public ProudNetServerService(ILogger <ProudNetServerService> logger, IServiceProvider serviceProvider,
                                     IOptions <NetworkOptions> networkOptions, IOptions <ThreadingOptions> threadingOptions,
                                     P2PGroupManager groupManager, UdpSocketManager udpSocketManager, ISchedulerService schedulerService,
                                     ISessionManagerFactory sessionManagerFactory, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory)
        {
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            _logger                              = logger;
            _serviceProvider                     = serviceProvider;
            _networkOptions                      = networkOptions.Value;
            _threadingOptions                    = threadingOptions.Value;
            _groupManager                        = groupManager;
            _udpSocketManager                    = udpSocketManager;
            _schedulerService                    = schedulerService;
            _magicNumberSessionManager           = sessionManagerFactory.GetSessionManager <Guid>(SessionManagerType.MagicNumber);
            _udpSessionManager                   = sessionManagerFactory.GetSessionManager <uint>(SessionManagerType.UdpId);
            InternalLoggerFactory.DefaultFactory = loggerFactory;

            var sessionManager = _serviceProvider.GetRequiredService <ISessionManager>();

            sessionManager.Added   += SessionManager_OnAdded;
            sessionManager.Removed += SessionManager_OnRemoved;
        }
Exemple #22
0
 public UpperBathroomConfiguration(
     CCToolsDeviceService ccToolsBoardService,
     IDeviceRegistryService deviceService,
     ISchedulerService schedulerService,
     IAreaRegistryService areaService,
     ISettingsService settingsService,
     AutomationFactory automationFactory,
     ActuatorFactory actuatorFactory,
     SensorFactory sensorFactory,
     IMessageBrokerService messageBroker,
     IDeviceMessageBrokerService deviceMessageBrokerService,
     ILogService logService)
 {
     _messageBroker = messageBroker;
     _deviceMessageBrokerService = deviceMessageBrokerService;
     _logService          = logService;
     _ccToolsBoardService = ccToolsBoardService ?? throw new ArgumentNullException(nameof(ccToolsBoardService));
     _deviceService       = deviceService ?? throw new ArgumentNullException(nameof(deviceService));
     _schedulerService    = schedulerService ?? throw new ArgumentNullException(nameof(schedulerService));
     _areaService         = areaService ?? throw new ArgumentNullException(nameof(areaService));
     _settingsService     = settingsService ?? throw new ArgumentNullException(nameof(settingsService));
     _automationFactory   = automationFactory ?? throw new ArgumentNullException(nameof(automationFactory));
     _actuatorFactory     = actuatorFactory ?? throw new ArgumentNullException(nameof(actuatorFactory));
     _sensorFactory       = sensorFactory ?? throw new ArgumentNullException(nameof(sensorFactory));
     _messageBroker       = messageBroker ?? throw new ArgumentNullException(nameof(sensorFactory));
 }
        public MetadataViewModel(Metadata metadata,
                                 Func <Metadata, IModifyResourceViewModel> modifyResourceFactory,
                                 Func <Exception, IExceptionViewModel> exceptionFactory,
                                 IRestClient restClient,
                                 IMessageService messageService,
                                 ISchedulerService schedulerService)
        {
            _exceptionFactory = exceptionFactory;
            _restClient       = restClient;
            _messageService   = messageService;
            _schedulerService = schedulerService;
            Metadata          = metadata;

            ModifyCommand = ReactiveCommand.Create()
                            .DisposeWith(this);

            DeleteCommand = ReactiveCommand.Create()
                            .DisposeWith(this);

            ModifyCommand.ActivateGestures()
            .Select(x => modifyResourceFactory(metadata))
            .Subscribe(x => messageService.Post("Modify Resource", x))
            .DisposeWith(this);

            Deleted = ObserveDelete();
        }
Exemple #24
0
        public AutomationFactory(
            ISchedulerService schedulerService,
            INotificationService notificationService,
            IDateTimeService dateTimeService,
            IDaylightService daylightService,
            IOutdoorTemperatureService outdoorTemperatureService,
            IComponentRegistryService componentService,
            ISettingsService settingsService,
            IResourceService resourceService)
        {
            if (schedulerService == null) throw new ArgumentNullException(nameof(schedulerService));
            if (notificationService == null) throw new ArgumentNullException(nameof(notificationService));
            if (dateTimeService == null) throw new ArgumentNullException(nameof(dateTimeService));
            if (daylightService == null) throw new ArgumentNullException(nameof(daylightService));
            if (outdoorTemperatureService == null) throw new ArgumentNullException(nameof(outdoorTemperatureService));
            if (componentService == null) throw new ArgumentNullException(nameof(componentService));
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));
            if (resourceService == null) throw new ArgumentNullException(nameof(resourceService));

            _schedulerService = schedulerService;
            _notificationService = notificationService;
            _dateTimeService = dateTimeService;
            _daylightService = daylightService;
            _outdoorTemperatureService = outdoorTemperatureService;
            _componentService = componentService;
            _settingsService = settingsService;
            _resourceService = resourceService;
        }
Exemple #25
0
        public void Config()
        {
            try
            {
                CodeSharp.Core.Configuration.ConfigWithEmbeddedXml(null
                                                                   , "application_config"
                                                                   , Assembly.GetExecutingAssembly()
                                                                   , "Taobao.Workflow.Activities.Test.ConfigFiles")
                .RenderProperties()
                .Castle(o => this.Resolve(o.Container));
                //设置容器
                Taobao.Activities.ActivityUtilities.Container(new Taobao.Workflow.Activities.Application.Container());
                Taobao.Activities.Hosting.WorkflowInstance.IsEnableDebug = false;
            }
            catch (InvalidOperationException e)
            {
                if (!e.Message.Contains("不可重复初始化配置"))
                {
                    Console.WriteLine(e.Message);
                }
            }

            this._log                = DependencyResolver.Resolve <ILoggerFactory>().Create(this.GetType());
            this._userService        = DependencyResolver.Resolve <IUserService>();
            this._processService     = DependencyResolver.Resolve <IProcessService>();
            this._processTypeService = DependencyResolver.Resolve <IProcessTypeService>();
            this._workItemService    = DependencyResolver.Resolve <IWorkItemService>();
            this._timeZoneService    = DependencyResolver.Resolve <ITimeZoneService>();
            this._resumptionService  = DependencyResolver.Resolve <ISchedulerService>();
            this._scheduler          = DependencyResolver.Resolve <IScheduler>();
            this._sessionManager     = DependencyResolver.Resolve <Castle.Facilities.NHibernateIntegration.ISessionManager>();
            this._managementApi      = DependencyResolver.Resolve <Taobao.Workflow.Activities.Management.ITFlowEngine>();
            this._clientApi          = DependencyResolver.Resolve <Taobao.Workflow.Activities.Client.ITFlowEngine>();
        }
 public TabularDataService(ISchedulerService schedulerService)
 {
     _schedulerService = schedulerService;
     using (Duration.Measure(Logger, "Constructor - " + GetType().Name))
     {
     }
 }
            public Configuration(
                CCToolsBoardService ccToolsBoardService, 
                IPi2GpioService pi2GpioService, 
                SynonymService synonymService,
                IDeviceService deviceService,
                II2CBusService i2CBusService, 
                ISchedulerService schedulerService, 
                RemoteSocketService remoteSocketService, 
                IApiService apiService,
                IContainer containerService)
            {
                if (ccToolsBoardService == null) throw new ArgumentNullException(nameof(ccToolsBoardService));
                if (pi2GpioService == null) throw new ArgumentNullException(nameof(pi2GpioService));
                if (synonymService == null) throw new ArgumentNullException(nameof(synonymService));
                if (deviceService == null) throw new ArgumentNullException(nameof(deviceService));
                if (i2CBusService == null) throw new ArgumentNullException(nameof(i2CBusService));
                if (schedulerService == null) throw new ArgumentNullException(nameof(schedulerService));
                if (remoteSocketService == null) throw new ArgumentNullException(nameof(remoteSocketService));
                if (apiService == null) throw new ArgumentNullException(nameof(apiService));
                if (containerService == null) throw new ArgumentNullException(nameof(containerService));

                _ccToolsBoardService = ccToolsBoardService;
                _pi2GpioService = pi2GpioService;
                _synonymService = synonymService;
                _deviceService = deviceService;
                _i2CBusService = i2CBusService;
                _schedulerService = schedulerService;
                _remoteSocketService = remoteSocketService;
                _apiService = apiService;
                _containerService = containerService;
            }
 public void RefreshAllUpcomingPrograms(ISchedulerService tvSchedulerServiceAgent, IControlService tvControlServiceAgent)
 {
     UpcomingRecording[] upcomingRecordings = tvControlServiceAgent.GetAllUpcomingRecordings(UpcomingRecordingsFilter.All, true);
     UpcomingGuideProgram[] upcomingAlerts = tvSchedulerServiceAgent.GetUpcomingGuidePrograms(ScheduleType.Alert, true);
     UpcomingGuideProgram[] upcomingSuggestions = tvSchedulerServiceAgent.GetUpcomingGuidePrograms(ScheduleType.Suggestion, true);
     _model.AllUpcomingGuidePrograms = new UpcomingGuideProgramsDictionary(upcomingRecordings, upcomingAlerts, upcomingSuggestions);
 }
        public OpenWeatherMapService(
            IOutdoorService outdoorService,
            IDaylightService daylightService,
            IDateTimeService dateTimeService,
            ISchedulerService schedulerService,
            ISystemInformationService systemInformationService,
            ISettingsService settingsService,
            IStorageService storageService,
            ILogService logService)
        {
            if (schedulerService == null)
            {
                throw new ArgumentNullException(nameof(schedulerService));
            }
            if (settingsService == null)
            {
                throw new ArgumentNullException(nameof(settingsService));
            }
            _outdoorService           = outdoorService ?? throw new ArgumentNullException(nameof(outdoorService));
            _daylightService          = daylightService ?? throw new ArgumentNullException(nameof(daylightService));
            _dateTimeService          = dateTimeService ?? throw new ArgumentNullException(nameof(dateTimeService));
            _systemInformationService = systemInformationService ?? throw new ArgumentNullException(nameof(systemInformationService));

            _log = logService?.CreatePublisher(nameof(OpenWeatherMapService)) ?? throw new ArgumentNullException(nameof(logService));

            settingsService.CreateSettingsMonitor <OpenWeatherMapServiceSettings>(s => Settings = s.NewSettings);

            schedulerService.Register("OpenWeatherMapServiceUpdater", TimeSpan.FromMinutes(5), RefreshAsync);
        }
 public EventBridgeLuaObject(IIoTService ioTService, ISchedulerService schedulerService, ICommandDispatcherService commandDispatcherService, IRuleEngineService ruleEngineService)
 {
     _ioTService               = ioTService;
     _schedulerService         = schedulerService;
     _commandDispatcherService = commandDispatcherService;
     _ruleEngineService        = ruleEngineService;
 }
Exemple #31
0
 public ProcessService(ILoggerFactory factory, IWorkflowParser parser, IEventBus eventBus, ISchedulerService schedulerService)
 {
     this._log              = factory.Create(typeof(ProcessService));
     this._parser           = parser;
     this._eventBus         = eventBus;
     this._schedulerService = schedulerService;
 }
Exemple #32
0
        public RollerShutterAutomation(
            string id,
            INotificationService notificationService,
            ISchedulerService schedulerService,
            IDateTimeService dateTimeService,
            IDaylightService daylightService,
            IOutdoorService outdoorTemperatureService,
            IComponentRegistryService componentRegistry,
            ISettingsService settingsService,
            IResourceService resourceService)
            : base(id)
        {
            if (resourceService == null)
            {
                throw new ArgumentNullException(nameof(resourceService));
            }

            _notificationService = notificationService ?? throw new ArgumentNullException(nameof(notificationService));
            _dateTimeService     = dateTimeService ?? throw new ArgumentNullException(nameof(dateTimeService));
            _daylightService     = daylightService ?? throw new ArgumentNullException(nameof(daylightService));
            _outdoorService      = outdoorTemperatureService ?? throw new ArgumentNullException(nameof(outdoorTemperatureService));
            _componentRegistry   = componentRegistry ?? throw new ArgumentNullException(nameof(componentRegistry));
            _settingsService     = settingsService ?? throw new ArgumentNullException(nameof(settingsService));

            resourceService.RegisterText(
                RollerShutterAutomationNotification.AutoClosingDueToHighOutsideTemperature,
                "Closing roller shutter because outside temperature reaches {AutoCloseIfTooHotTemperaure}°C.");

            settingsService.CreateSettingsMonitor <RollerShutterAutomationSettings>(this, s => Settings = s.NewSettings);

            schedulerService.Register(id, TimeSpan.FromMinutes(1), () => PerformPendingActions());
        }
        public static string GetLogoPath(ISchedulerService tvSchedulerAgent, Guid channelId, string channelDisplayName, int width, int height)
        {
            string cachePath = Path.Combine(_cacheBasePath, width.ToString(CultureInfo.InvariantCulture) + "x" + height.ToString(CultureInfo.InvariantCulture));
            Directory.CreateDirectory(cachePath);

            string logoImagePath = Path.Combine(cachePath, MakeValidFileName(channelDisplayName) + ".png");

            DateTime modifiedDateTime = DateTime.MinValue;
            if (File.Exists(logoImagePath))
            {
                modifiedDateTime = File.GetLastWriteTime(logoImagePath);
            }

            byte[] imageBytes = tvSchedulerAgent.GetChannelLogo(channelId, width, height, true, modifiedDateTime);
            if (imageBytes == null)
            {
                if (File.Exists(logoImagePath))
                {
                    File.Delete(logoImagePath);
                }
            }
            else if (imageBytes.Length > 0)
            {
                using (FileStream imageStream = new FileStream(logoImagePath, FileMode.Create))
                {
                    imageStream.Write(imageBytes, 0, imageBytes.Length);
                    imageStream.Close();
                }
            }

            return File.Exists(logoImagePath) ? logoImagePath : null;
        }
Exemple #34
0
 public ScheduleWorker(
     string taskName, ISchedulerService parent, IExtendedCacheClient cacheClient)
 {
     this.taskName    = taskName;
     this.cacheClient = cacheClient;
     this.parent      = parent;
 }
        public DiagnosticsViewModel(IDiagnosticsService diagnosticsService, ISchedulerService schedulerService)
        {
            Cpu           = Constants.UI.Diagnostics.DefaultCpuString;
            ManagedMemory = Constants.UI.Diagnostics.DefaultManagedMemoryString;
            TotalMemory   = Constants.UI.Diagnostics.DefaultTotalMemoryString;

            diagnosticsService.Cpu
            .Select(x => FormatCpu(x))
            .DistinctUntilChanged()
            .ObserveOn(schedulerService.Dispatcher)
            .Subscribe(x => Cpu = x,
                       e =>
            {
                Logger.Error(e);
                Cpu = Constants.UI.Diagnostics.DefaultCpuString;
            })
            .DisposeWith(this);

            diagnosticsService.Memory
            .Select(x => FormatMemory(x))
            .DistinctUntilChanged()
            .ObserveOn(schedulerService.Dispatcher)
            .Subscribe(x =>
            {
                ManagedMemory = x.ManagedMemory;
                TotalMemory   = x.TotalMemory;
            },
                       e =>
            {
                Logger.Error(e);
                ManagedMemory = Constants.UI.Diagnostics.DefaultManagedMemoryString;
                TotalMemory   = Constants.UI.Diagnostics.DefaultTotalMemoryString;
            })
            .DisposeWith(this);
        }
        public ControllerSlaveService(
            ISettingsService settingsService,
            ISchedulerService scheduler,
            IDateTimeService dateTimeService,
            IOutdoorTemperatureService outdoorTemperatureService,
            IOutdoorHumidityService outdoorHumidityService,
            IDaylightService daylightService,
            IWeatherService weatherService)
        {
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));
            if (scheduler == null) throw new ArgumentNullException(nameof(scheduler));
            if (dateTimeService == null) throw new ArgumentNullException(nameof(dateTimeService));
            if (outdoorTemperatureService == null) throw new ArgumentNullException(nameof(outdoorTemperatureService));
            if (outdoorHumidityService == null) throw new ArgumentNullException(nameof(outdoorHumidityService));
            if (daylightService == null) throw new ArgumentNullException(nameof(daylightService));
            if (weatherService == null) throw new ArgumentNullException(nameof(weatherService));

            _dateTimeService = dateTimeService;
            _outdoorTemperatureService = outdoorTemperatureService;
            _outdoorHumidityService = outdoorHumidityService;
            _daylightService = daylightService;
            _weatherService = weatherService;

            settingsService.CreateSettingsMonitor<ControllerSlaveServiceSettings>(s => Settings = s);

            scheduler.RegisterSchedule("ControllerSlavePolling", TimeSpan.FromMinutes(5), PullValues);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="TestQueueExecutableService" /> class.
 /// </summary>
 /// <param name="table">The table test data.</param>
 /// <param name="suiteService">The suite service.</param>
 /// <param name="testQueueService">The test queue service.</param>
 /// <param name="mapperFactory">The mapper factory.</param>
 /// <param name="schedulerService">The scheduler service.</param>
 /// <param name="browserService">The browser service.</param>
 /// <param name="actionService">The action service.</param>
 /// <param name="testDataSharedTestDataMapService">The test data shared test data map service.</param>
 /// <param name="sharedTestDataService">The shared test data service.</param>
 /// <param name="apiConncetionService">The API conncetion service.</param>
 /// <param name="schedulerHistoryService">The scheduler history service.</param>
 /// <param name="environmentService">The environment service.</param>
 /// <param name="reportLinkDataService">The report data service.</param>
 public TestQueueExecutableService(
     IRepository <TblTestData> table,
     ISuiteService suiteService,
     ITestQueueService testQueueService,
     IMapperFactory mapperFactory,
     ISchedulerService schedulerService,
     IBrowserService browserService,
     IActionsService actionService,
     ITestDataSharedTestDataMapService testDataSharedTestDataMapService,
     ISharedTestDataService sharedTestDataService,
     IApiConnectionService apiConncetionService,
     ISchedulerHistoryService schedulerHistoryService,
     IEnvironmentService environmentService,
     IReportLinkDataService reportLinkDataService)
 {
     this.table            = table;
     this.suiteService     = suiteService;
     this.mapperFactory    = mapperFactory;
     this.schedulerService = schedulerService;
     this.testQueueService = testQueueService;
     this.browserService   = browserService;
     this.actionService    = actionService;
     this.testDataSharedTestDataMapService = testDataSharedTestDataMapService;
     this.sharedTestDataService            = sharedTestDataService;
     this.apiConncetionService             = apiConncetionService;
     this.schedulerHistoryService          = schedulerHistoryService;
     this.environmentService    = environmentService;
     this.reportLinkDataService = reportLinkDataService;
 }
Exemple #38
0
        public MotionDetector(ComponentId id, IMotionDetectorEndpoint endpoint, ISchedulerService schedulerService)
            : base(id)
        {
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }
            if (schedulerService == null)
            {
                throw new ArgumentNullException(nameof(schedulerService));
            }

            _schedulerService = schedulerService;

            SetState(MotionDetectorStateId.Idle);

            endpoint.MotionDetected     += (s, e) => UpdateState(MotionDetectorStateId.MotionDetected);
            endpoint.DetectionCompleted += (s, e) => UpdateState(MotionDetectorStateId.Idle);

            Settings.ValueChanged += (s, e) =>
            {
                if (e.SettingName == "IsEnabled")
                {
                    HandleIsEnabledStateChanged();
                }
            };
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="SchedulerController" /> class.
 /// </summary>
 /// <param name="loggerService">The logger service.</param>
 /// <param name="schedulerService">The scheduler service.</param>
 /// <param name="schedulerSuiteMapService">The schedulerSuite service.</param>
 /// <param name="schedulerHistoryService">The scheduler history service.</param>
 public SchedulerController(ILoggerService loggerService, ISchedulerService schedulerService, ISchedulerSuiteMapService schedulerSuiteMapService, ISchedulerHistoryService schedulerHistoryService)
     : base(loggerService)
 {
     this.schedulerService         = schedulerService;
     this.schedulerSuiteMapService = schedulerSuiteMapService;
     this.schedulerHistoryService  = schedulerHistoryService;
 }
        public OpenWeatherMapService(
            IOutdoorTemperatureService outdoorTemperatureService,
            IOutdoorHumidityService outdoorHumidityService,
            IDaylightService daylightService,
            IWeatherService weatherService,
            IDateTimeService dateTimeService, 
            ISchedulerService schedulerService, 
            ISystemInformationService systemInformationService,
            ISettingsService settingsService, 
            IStorageService storageService)
        {
            if (outdoorTemperatureService == null) throw new ArgumentNullException(nameof(outdoorTemperatureService));
            if (outdoorHumidityService == null) throw new ArgumentNullException(nameof(outdoorHumidityService));
            if (daylightService == null) throw new ArgumentNullException(nameof(daylightService));
            if (weatherService == null) throw new ArgumentNullException(nameof(weatherService));
            if (dateTimeService == null) throw new ArgumentNullException(nameof(dateTimeService));
            if (systemInformationService == null) throw new ArgumentNullException(nameof(systemInformationService));
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));
            if (storageService == null) throw new ArgumentNullException(nameof(storageService));

            _outdoorTemperatureService = outdoorTemperatureService;
            _outdoorHumidityService = outdoorHumidityService;
            _daylightService = daylightService;
            _weatherService = weatherService;
            _dateTimeService = dateTimeService;
            _systemInformationService = systemInformationService;
            _storageService = storageService;

            settingsService.CreateSettingsMonitor<OpenWeatherMapServiceSettings>(s => Settings = s);

            LoadPersistedData();

            schedulerService.RegisterSchedule("OpenWeatherMapServiceUpdater", TimeSpan.FromMinutes(5), Refresh);
        }
Exemple #41
0
        public ControllerSlaveService(
            ISettingsService settingsService,
            ISchedulerService scheduler,
            IDateTimeService dateTimeService,
            IOutdoorService outdoorService,
            IDaylightService daylightService,
            ILogService logService)
        {
            if (settingsService == null)
            {
                throw new ArgumentNullException(nameof(settingsService));
            }
            if (scheduler == null)
            {
                throw new ArgumentNullException(nameof(scheduler));
            }

            _dateTimeService = dateTimeService ?? throw new ArgumentNullException(nameof(dateTimeService));
            _outdoorService  = outdoorService ?? throw new ArgumentNullException(nameof(outdoorService));
            _daylightService = daylightService ?? throw new ArgumentNullException(nameof(daylightService));

            _log = logService?.CreatePublisher(nameof(ControllerSlaveService)) ?? throw new ArgumentNullException(nameof(logService));

            settingsService.CreateSettingsMonitor <ControllerSlaveServiceSettings>(s => Settings = s.NewSettings);

            scheduler.Register("ControllerSlavePolling", TimeSpan.FromMinutes(5), () => PullValues());
        }
        public TestRollerShutter(ComponentId id, TestRollerShutterEndpoint endpoint, ITimerService timerService, ISchedulerService schedulerService, ISettingsService settingsService)
            : base(id, endpoint, timerService, schedulerService, settingsService)
        {
            if (endpoint == null) throw new ArgumentNullException(nameof(endpoint));

            Endpoint = endpoint;
        }
        public TestMotionDetector(ComponentId id, TestMotionDetectorEndpoint endpoint, ISchedulerService schedulerService, ISettingsService settingsService)
            : base(id, endpoint, schedulerService, settingsService)
        {
            if (endpoint == null) throw new ArgumentNullException(nameof(endpoint));
            if (schedulerService == null) throw new ArgumentNullException(nameof(schedulerService));

            Endpoint = endpoint;
        }
        public DHT22Accessor(I2CHardwareBridge i2CHardwareBridge, ISchedulerService schedulerService)
        {
            if (i2CHardwareBridge == null) throw new ArgumentNullException(nameof(i2CHardwareBridge));
            if (schedulerService == null) throw new ArgumentNullException(nameof(schedulerService));

            _i2CHardwareBridge = i2CHardwareBridge;
            schedulerService.RegisterSchedule("DHT22Updater", TimeSpan.FromSeconds(10), FetchValues);
        }
        public RemoteSocketService(ISchedulerService schedulerService)
        {
            if (schedulerService == null) throw new ArgumentNullException(nameof(schedulerService));

            // Ensure that the state of the remote switch is restored if the original remote is used
            // or the switch has been removed from the socket and plugged in at another place.
            schedulerService.RegisterSchedule("RCSocketStateSender", TimeSpan.FromSeconds(5), RefreshStates);
        }
        public TestMotionDetectorFactory(ISchedulerService schedulerService, ISettingsService settingsService)
        {
            if (schedulerService == null) throw new ArgumentNullException(nameof(schedulerService));
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));

            _schedulerService = schedulerService;
            _settingsService = settingsService;
        }
        public TestRollerShutterFactory(ITimerService timerService, ISchedulerService schedulerService, ISettingsService settingsService)
        {
            if (timerService == null) throw new ArgumentNullException(nameof(timerService));
            if (schedulerService == null) throw new ArgumentNullException(nameof(schedulerService));

            _timerService = timerService;
            _schedulerService = schedulerService;
            _settingsService = settingsService;
        }
        public ExerciseViewModel(ISchedulerService schedulerService, Exercise model, IObservable<ExecutionContext> executionContext)
        {
            schedulerService.AssertNotNull(nameof(schedulerService));
            model.AssertNotNull(nameof(model));
            executionContext.AssertNotNull(nameof(executionContext));

            this.disposables = new CompositeDisposable();
            this.model = model;

            executionContext
                .ObserveOn(schedulerService.MainScheduler)
                .Subscribe(x => this.ExecutionContext = x)
                .AddTo(this.disposables);

            Observable
                .CombineLatest(
                    this
                        .WhenAnyValue(x => x.ExecutionContext)
                        .Select(ec => ec == null ? Observable.Never<TimeSpan>() : ec.WhenAnyValue(x => x.SkipAhead))
                        .Switch(),
                    this
                        .WhenAnyValue(x => x.ExecutionContext)
                        .Select(ec => ec == null ? Observable.Never<Exercise>() : ec.WhenAnyValue(x => x.CurrentExercise))
                        .Switch(),
                    (skip, current) => skip == TimeSpan.Zero && current == this.model)
                .ObserveOn(schedulerService.MainScheduler)
                .Subscribe(x => this.IsActive = x)
                .AddTo(this.disposables);

            this
                .WhenAnyValue(x => x.ExecutionContext)
                .Select(
                    ec =>
                        ec == null
                            ? Observable.Return(TimeSpan.Zero)
                            : ec
                                .WhenAnyValue(x => x.CurrentExerciseProgress)
                                .Where(_ => ec.CurrentExercise == this.model)
                                .StartWith(TimeSpan.Zero))
                .Switch()
                .ObserveOn(schedulerService.MainScheduler)
                .Subscribe(x => this.ProgressTimeSpan = x)
                .AddTo(this.disposables);

            this
                .WhenAny(
                    x => x.Duration,
                    x => x.ProgressTimeSpan,
                    (duration, progressTimeSpan) => progressTimeSpan.Value.TotalMilliseconds / duration.Value.TotalMilliseconds)
                .Select(progressRatio => double.IsNaN(progressRatio) || double.IsInfinity(progressRatio) ? 0d : progressRatio)
                .Select(progressRatio => Math.Min(1d, progressRatio))
                .Select(progressRatio => Math.Max(0d, progressRatio))
                .ObserveOn(schedulerService.MainScheduler)
                .Subscribe(x => this.Progress = x)
                .AddTo(this.disposables);
        }
Exemple #49
0
 public static Schedule CreateRecordRepeatingSchedule(ISchedulerService tvSchedulerAgent, IGuideService tvGuideAgent,
     RepeatingType repeatingType, ChannelType channelType, Guid channelId, Guid guideProgramId, string titleSuffix = null)
 {
     GuideProgram guideProgram = tvGuideAgent.GetProgramById(guideProgramId);
     if (guideProgram != null)
     {
         return CreateRecordRepeatingSchedule(tvSchedulerAgent, repeatingType, channelType, channelId, guideProgram.Title, guideProgram.StartTime, titleSuffix);
     }
     return null;
 }
        public BathroomFanAutomation(AutomationId id, ISchedulerService schedulerService, ISettingsService settingsService)
            : base(id)
        {
            if (schedulerService == null) throw new ArgumentNullException(nameof(schedulerService));
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));

            _schedulerService = schedulerService;

            settingsService.CreateSettingsMonitor<BathroomFanAutomationSettings>(Id, s => Settings = s);
        }
 public SubProcessCompleteWaitingResumption(ILoggerFactory factory
      , IWorkflowParser parser
      , IProcessService processService
      , ISchedulerService resumption)
 {
     this._log = factory.Create(typeof(SubProcessCompleteWaitingResumption));
     this._parser = parser;
     this._processService = processService;
     this._resumption = resumption;
 }
        public I2CHardwareBridge(I2CSlaveAddress address, II2CBusService i2CBus, ISchedulerService schedulerService)
        {
            if (i2CBus == null) throw new ArgumentNullException(nameof(i2CBus));
            if (schedulerService == null) throw new ArgumentNullException(nameof(schedulerService));

            _address = address;
            _i2CBus = i2CBus;

            DHT22Accessor = new DHT22Accessor(this, schedulerService);
        }
Exemple #53
0
 public Cleaner(ITradeRepository tradeRepository, IAnalyticsService analyticsService,
     IExecutionService executionService, IPriceLastValueCache priceLastValueCache,
     ISchedulerService scheduler)
 {
     _tradeRepository = tradeRepository;
     _analyticsService = analyticsService;
     _executionService = executionService;
     _priceLastValueCache = priceLastValueCache;
     _scheduler = scheduler;
 }
        public ConditionalOnAutomation(AutomationId id, ISchedulerService schedulerService, IDateTimeService dateTimeService, IDaylightService daylightService)
            : base(id)
        {
            if (dateTimeService == null) throw new ArgumentNullException(nameof(dateTimeService));
            if (daylightService == null) throw new ArgumentNullException(nameof(daylightService));

            _dateTimeService = dateTimeService;
            _daylightService = daylightService;

            WithTrigger(new IntervalTrigger(TimeSpan.FromMinutes(1), schedulerService));
        }
Exemple #55
0
 public static Schedule CreateRecordOnceSchedule(ISchedulerService tvSchedulerAgent, IGuideService tvGuideAgent,
     ChannelType channelType, Guid channelId, Guid guideProgramId)
 {
     GuideProgram guideProgram = tvGuideAgent.GetProgramById(guideProgramId);
     if (guideProgram != null)
     {
         return CreateRecordOnceSchedule(tvSchedulerAgent, channelType,
             channelId, guideProgram.Title, guideProgram.SubTitle, guideProgram.EpisodeNumberDisplay, guideProgram.StartTime);
     }
     return null;
 }
 public WorkflowInstanceStoreHelper(ILoggerFactory factory
     , IProcessService processService
     , IUserService userService
     , ISchedulerService schedulerService
     , IEventBus bus)
 {
     this._log = factory.Create(typeof(WorkflowInstanceStoreHelper));
     this._processService = processService;
     this._schedulerService = schedulerService;
     this._bus = bus;
 }
 public HumanEscalationWaitingResumption(ILoggerFactory factory
     , ISchedulerService schedulerService
     , IWorkItemService workItemService
     , IScriptParser parser
     , IHumanEscalationHelper helper)
 {
     this._log = factory.Create(typeof(HumanEscalationWaitingResumption));
     this._schedulerService = schedulerService;
     this._workItemService = workItemService;
     this._parser = parser;
     this._helper = helper;
 }
        public void SetUp()
        {
            _tradeRepo = Substitute.For<ITradeRepository>();
            _analyticsService = Substitute.For<IAnalyticsService>();
            _executionService = Substitute.For<IExecutionService>();
            _lastValueCache = Substitute.For<IPriceLastValueCache>();

            _scheduler = new HistoricalScheduler();
            _scheduler.AdvanceTo(DateTimeOffset.Now);

            _schedulerService = Substitute.For<ISchedulerService>();
            _schedulerService.ThreadPool.Returns(_scheduler);
        }
        public TurnOnAndOffAutomation(AutomationId id, IDateTimeService dateTimeService, ISchedulerService schedulerService, ISettingsService settingsService, IDaylightService daylightService)
            : base(id)
        {
            if (dateTimeService == null) throw new ArgumentNullException(nameof(dateTimeService));
            if (schedulerService == null) throw new ArgumentNullException(nameof(schedulerService));
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));
            if (daylightService == null) throw new ArgumentNullException(nameof(daylightService));

            _dateTimeService = dateTimeService;
            _schedulerService = schedulerService;
            _daylightService = daylightService;

            settingsService.CreateSettingsMonitor<TurnOnAndOffAutomationSettings>(Id, s => Settings = s);
        }
 //private IEngineIntegrationService _integrationService;
 public HumanEscalationHelper(ILoggerFactory factory
     , IWorkItemService workItemService
     , IUserService userService
     , ISchedulerService schedulerService
     , ProcessService processService)
     //, IEngineIntegrationService integrationService)
     : base(factory
     , workItemService
     , userService
     , schedulerService
     , processService)
 {
     //this._integrationService = integrationService;
 }