コード例 #1
0
ファイル: DeviceService.cs プロジェクト: sindab/HA4IoT
        public DeviceService(
            ISystemEventsService systemEventsService,
            ISystemInformationService systemInformationService)
        {
            if (systemEventsService == null)
            {
                throw new ArgumentNullException(nameof(systemEventsService));
            }
            if (systemInformationService == null)
            {
                throw new ArgumentNullException(nameof(systemInformationService));
            }

            systemEventsService.StartupCompleted += (s, e) =>
            {
                systemInformationService.Set("Devices/Count", _devices.GetAll().Count);
            };
        }
コード例 #2
0
 public IList <TDevice> Devices <TDevice>() where TDevice : IDevice
 {
     return(_devices.GetAll <TDevice>());
 }