Esempio n. 1
0
        public void SetAllLights(Color color)
        {
            if (!IsInitialized)
            {
                return;
            }

            try
            {
                if (_mysticOtherDevices)
                {
                    string[] devTypes = null;
                    int[]    devLeds  = null;

                    var devs = MysticSdkWrapper.GetDeviceInfo(out devTypes, out devLeds);

                    var x = 0;
                    foreach (var device in devTypes)
                    {
                        if (x > devLeds.Length)
                        {
                            continue;
                        }

                        MysticSdkWrapper.SetLedColor(device, devLeds[x], color.R, color.G, color.B);
                        x++;
                    }
                }
            }
            catch (Exception ex)
            {
                Write.WriteConsole(ConsoleTypes.Mystic, @"Mystic: " + ex.Message);
                Write.WriteConsole(ConsoleTypes.Mystic, @"Internal Error: " + ex.StackTrace);
            }
        }
Esempio n. 2
0
        public bool InitializeLights()
        {
            var result = true;

            try
            {
                MysticSdkWrapper.Reload();

                int errorCode;
                if ((errorCode = MysticSdkWrapper.Initialize()) != 0)
                {
                    return(false);
                }

                result        = true;
                IsInitialized = true;

                string[] devTypes = null;
                int[]    devLeds  = null;

                var devs = MysticSdkWrapper.GetDeviceInfo(out devTypes, out devLeds);

                var x = 0;
                foreach (var device in devTypes)
                {
                    Write.WriteConsole(ConsoleTypes.Mystic, @"DEBUG: Mystic Device: " + device + " (" + devLeds[x] + ")");
                    x++;
                }
            }
            catch (Exception)
            {
                result = false;
            }
            return(result);
        }
Esempio n. 3
0
 public void ShutdownSdk()
 {
     try
     {
         MysticSdkWrapper.UnloadMsiSDK();
     }
     catch (Exception ex)
     {
         Write.WriteConsole(ConsoleTypes.Mystic, @"Mystic: " + ex.Message);
     }
 }