当前位置: 首页>>代码示例>>C#>>正文


C# IResourceService.RegisterText方法代码示例

本文整理汇总了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.");
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:13,代码来源:SystemEventsService.cs

示例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);
        }
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:37,代码来源:RollerShutterAutomation.cs


注:本文中的IResourceService.RegisterText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。