Ejemplo n.º 1
0
        private void DetectDevices()
        {
            //get all devices from colore, with the respective names and Guids
            IEnumerable <(string Name, Guid Guid)> DeviceGuids = typeof(Corale.Colore.Razer.Devices).GetFields().Select(f =>
                                                                                                                        (f.Name,
                                                                                                                         (Guid)f.GetValue(null)));

            deviceNames.Clear();

            foreach (var device in DeviceGuids.Where(d => d.Name != "Razer Core Chroma"))//somehow this device is unsupported, can't query it
            {
                try
                {
                    var devInfo = Chroma.Instance.Query(device.Guid);
                    if (devInfo.Connected)
                    {
                        deviceNames.Add(device.Name);
                    }
                }
                catch (Corale.Colore.Razer.NativeCallException e)
                {
                    LogError("Error querying device: " + e.Message);
                }
            }
        }
Ejemplo n.º 2
0
        private void DetectDevices()
        {
            deviceNames.Clear();

            foreach (var device in DeviceGuids.Where(d => d.Name != "Razer Core Chroma"))//somehow this device is unsupported, can't query it
            {
                try
                {
                    var devInfo = Chroma.Instance.Query(device.Guid);
                    if (devInfo.Connected)
                    {
                        deviceNames.Add(device.Name);
                    }
                }
                catch (Corale.Colore.Razer.NativeCallException e)
                {
                    LogError("Error querying device: " + e.Message);
                }
            }
        }