本文整理汇总了C#中ISchedulerService类的典型用法代码示例。如果您正苦于以下问题:C# ISchedulerService类的具体用法?C# ISchedulerService怎么用?C# ISchedulerService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISchedulerService类属于命名空间,在下文中一共展示了ISchedulerService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetLogoPath
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;
}
示例2: 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);
}
示例3: AutomationFactory
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;
}
示例4: RollerShutter
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);
}
示例5: Configuration
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;
}
示例6: 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);
}
示例7: LowerBathroomConfiguration
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;
}
示例8: TestRollerShutter
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;
}
示例9: 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);
}
示例10: Config
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>();
}
示例11: RefreshAllUpcomingPrograms
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);
}
示例12: 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);
}
示例13: TestMotionDetector
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;
}
示例14: 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);
}
示例15: TestMotionDetectorFactory
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;
}