示例#1
0
        public static void ChangeAllDevicesColor(Color color)
        {
            PrintLine("Starting SDK...");
            MyAuraSdk.SwitchMode();
            var allDevices = MyAuraSdk.Enumerate(0);

            Console.Clear();
            foreach (IAuraSyncDevice allDevice in allDevices)
            {
                Print($"Setting device {allDevice.Name}...");
                StopWatch.Restart();
                foreach (IAuraRgbLight light in allDevice.Lights)
                {
                    light.Red   = color.R;
                    light.Green = color.G;
                    light.Blue  = color.B;
                }

                allDevice.Apply();
                StopWatch.Stop();
                PrintLine($"Done! took {StopWatch.ElapsedMilliseconds}ms");
            }
            PrintLine("Stopping SDK...");
            MyAuraSdk.ReleaseControl(0);
        }
示例#2
0
 public void Dispose()
 {
     _sdk?.ReleaseControl(0);
     _sdk = null;
 }
示例#3
0
 public void ReleaseControl()
 {
     sdk.ReleaseControl(0);
 }
示例#4
0
 /// <inheritdoc />
 public void ResetDevices()
 {
     _sdk?.ReleaseControl(0);
     _sdk?.SwitchMode();
 }
示例#5
0
 public override void Deactivate()
 {
     sdk.ReleaseControl(0);
     devs = null;
 }