本文整理汇总了C#中IResourceService.RegisterText方法的典型用法代码示例。如果您正苦于以下问题:C# IResourceService.RegisterText方法的具体用法?C# IResourceService.RegisterText怎么用?C# IResourceService.RegisterText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IResourceService
的用法示例。
在下文中一共展示了IResourceService.RegisterText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SystemEventsService
public SystemEventsService(IController controller, INotificationService notificationService, IResourceService resourceService)
{
if (controller == null) throw new ArgumentNullException(nameof(controller));
if (notificationService == null) throw new ArgumentNullException(nameof(notificationService));
_notificationService = notificationService;
controller.StartupCompleted += OnStartupCompleted;
controller.StartupFailed += (s, e) => StartupFailed?.Invoke(this, EventArgs.Empty);
controller.Shutdown += (s, e) => Shutdown?.Invoke(this, EventArgs.Empty);
resourceService.RegisterText(SystemEventNotification.Booted, "System is booted.");
}
示例2: 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);
}