Пример #1
0
        public LampDevice(DeviceCreationInfo creationInfo)
            : base(new LampState(), creationInfo)
        {
            mService = (LampServiceBase)creationInfo.ServiceManager.GetService(typeof(LampServiceBase));
            if (mService == null)
                throw new InvalidOperationException("LampService is missing, device cannot run");

            State.Dimmable = true;
            State.Channel = int.Parse(creationInfo.Configuration.channel);
        }
Пример #2
0
        public LampDevice(DeviceCreationInfo creationInfo)
            : base(new LampState(), creationInfo)
        {
            mService = (LampServiceBase)creationInfo.ServiceManager.GetService(typeof(LampServiceBase));
            if (mService == null)
            {
                throw new InvalidOperationException("LampService is missing, device cannot run");
            }

            State.Dimmable = true;
            State.Channel  = int.Parse(creationInfo.Configuration.channel);
        }