Ejemplo n.º 1
0
        public void MapDevice(IChannelIdentity channelIdentity, LogicalDevice.IHasBrightnessControl device)
        {
            var mappedDevice = new MappedDeviceDimmer(device);

            InternalMapDevice(channelIdentity, mappedDevice);

            device.Brightness = 0.0;
        }
Ejemplo n.º 2
0
        protected void InternalMapDevice(IChannelIdentity channelIdentity, MappedDeviceDimmer device)
        {
            HashSet <MappedDeviceDimmer> devices;

            if (!mappedDevices.TryGetValue(channelIdentity, out devices))
            {
                devices = new HashSet <MappedDeviceDimmer>();
                mappedDevices[channelIdentity] = devices;
            }
            devices.Add(device);

            this.channelData[channelIdentity].Mapped = true;

            if (device.Device is IControlledDevice)
            {
                this.controlledDevices.Add((IControlledDevice)device.Device);
            }
            if (device.Device is LogicalDevice.IHasControlledDevice)
            {
                this.controlledDevices.Add(((LogicalDevice.IHasControlledDevice)device.Device).ControlledDevice);
            }
        }