Beispiel #1
0
        internal ArtemisDevice(IRGBDevice rgbDevice, DeviceProvider deviceProvider, DeviceEntity deviceEntity)
        {
            Identifier     = rgbDevice.GetDeviceIdentifier();
            DeviceEntity   = deviceEntity;
            RgbDevice      = rgbDevice;
            DeviceProvider = deviceProvider;

            InputIdentifiers = new List <ArtemisDeviceInputIdentifier>();
            foreach (DeviceInputIdentifierEntity identifierEntity in DeviceEntity.InputIdentifiers)
            {
                InputIdentifiers.Add(new ArtemisDeviceInputIdentifier(identifierEntity.InputProvider, identifierEntity.Identifier));
            }

            Leds   = rgbDevice.Select(l => new ArtemisLed(l, this)).ToList().AsReadOnly();
            LedIds = new ReadOnlyDictionary <LedId, ArtemisLed>(Leds.ToDictionary(l => l.RgbLed.Id, l => l));

            ApplyKeyboardLayout();
        }
Beispiel #2
0
        internal ArtemisDevice(IRGBDevice rgbDevice, DeviceProvider deviceProvider)
        {
            Identifier     = rgbDevice.GetDeviceIdentifier();
            DeviceEntity   = new DeviceEntity();
            RgbDevice      = rgbDevice;
            DeviceProvider = deviceProvider;

            Rotation   = 0;
            Scale      = 1;
            ZIndex     = 1;
            RedScale   = 1;
            GreenScale = 1;
            BlueScale  = 1;
            IsEnabled  = true;

            InputIdentifiers = new List <ArtemisDeviceInputIdentifier>();

            Leds   = rgbDevice.Select(l => new ArtemisLed(l, this)).ToList().AsReadOnly();
            LedIds = new ReadOnlyDictionary <LedId, ArtemisLed>(Leds.ToDictionary(l => l.RgbLed.Id, l => l));

            ApplyKeyboardLayout();
            ApplyToEntity();
            CalculateRenderProperties();
        }