本文整理汇总了C#中ISchedulerService.RegisterSchedule方法的典型用法代码示例。如果您正苦于以下问题:C# ISchedulerService.RegisterSchedule方法的具体用法?C# ISchedulerService.RegisterSchedule怎么用?C# ISchedulerService.RegisterSchedule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISchedulerService
的用法示例。
在下文中一共展示了ISchedulerService.RegisterSchedule方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ControllerSlaveService
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);
}
示例2: OpenWeatherMapService
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);
}
示例3: NotificationService
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);
}
示例4: DHT22Accessor
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);
}
示例5: RemoteSocketService
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);
}
示例6: RollerShutterAutomation
public RollerShutterAutomation(
AutomationId id,
INotificationService notificationService,
ISchedulerService schedulerService,
IDateTimeService dateTimeService,
IDaylightService daylightService,
IOutdoorTemperatureService outdoorTemperatureService,
IComponentService componentService,
ISettingsService settingsService,
IResourceService resourceService)
: base(id)
{
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));
_notificationService = notificationService;
_dateTimeService = dateTimeService;
_daylightService = daylightService;
_outdoorTemperatureService = outdoorTemperatureService;
_componentService = componentService;
_settingsService = settingsService;
_componentService = componentService;
resourceService.RegisterText(
RollerShutterAutomationNotification.AutoClosingDueToHighOutsideTemperature,
"Closing roller shutter because outside temperature reaches {AutoCloseIfTooHotTemperaure}°C.");
settingsService.CreateSettingsMonitor<RollerShutterAutomationSettings>(Id, s => Settings = s);
// TODO: Consider timer service here.
schedulerService.RegisterSchedule("RollerShutterAutomation-" + Guid.NewGuid(), TimeSpan.FromMinutes(1), PerformPendingActions);
}
示例7: IntervalTrigger
public IntervalTrigger(TimeSpan interval, ISchedulerService scheduleService)
{
if (scheduleService == null) throw new ArgumentNullException(nameof(scheduleService));
scheduleService.RegisterSchedule("IntervalTrigger-" + Guid.NewGuid(), interval, Execute);
}