protected Controller()
        {
            Channels = new Channel[MaxChannels];
            for (int i = 0; i < Channels.Length; i++)
            {
                Channels[i] = new Channel();
            }
            ControllerValues = new UInt16[MaxChannels];

            const int devicesPerChild = ChannelsPerChild/3;
            const int rgbDeviceCount = devicesPerChild * ChildNodes;

            RgbDevices = new RgbDevice[rgbDeviceCount];

            for (int i = 0; i != rgbDeviceCount; i++)
            {
                int child = i / devicesPerChild;
                int firstChannel = (child * ChannelsPerChild) + (i%devicesPerChild);
                RgbDevices[i] = new RgbDevice(Channels[firstChannel], Channels[firstChannel+1], Channels[firstChannel+2], "RGB Device " + i);
            }

            _worker = new Timer();
            _worker.Elapsed += Work;
            _worker.Interval = 16;
        }
        public SimpleRgbDeviceControl(RgbDevice device)
        {
            InitializeComponent();

            ColorCanvas.SelectedColor = ColorConverter.Convert(device.Color);
            ColorCanvas.SelectedColorChanged += (s, a) => device.Color = ColorConverter.Convert(a.NewValue);
        }
 public ScreenSampleSpecification(RgbDevice rgbDevice, Rectangle sampleArea, String name)
     : this(rgbDevice, sampleArea)
 {
     _name = name;
 }
 public ScreenSampleSpecification(RgbDevice rgbDevice, Rectangle sampleArea)
 {
     _rgbDevice = rgbDevice;
     _sampleArea = sampleArea;
 }