public static async Task <bool> SetLED(int id, LEDMode mode, LEDColor color = LEDColor.All)
        {
            if (isDemoModeActive)
            {
                return(false);
            }

            try
            {
                bool response = await Task.Run(() => MasterDelegate(() => connection.SetLED(id, mode.ToString(), color.ToString())));

                return(false);
            }
            catch (Exception e)
            {
                Debug.WriteLine(e);
                return(false);
            }
        }
예제 #2
0
 private void buttonSwitch_Click(object sender, RoutedEventArgs e)
 {
     if (CurrentMode == LEDMode.Screen)
     {
         Logger.QueueLine("Switching LED Mode: Audio");
         CurrentMode = LEDMode.Audio;
         DrawTimer.Stop();
         aColors = new AudioColors();
         sColors.Dispose();
         sColors = null;
         buttonSwitch.Content = "_Switch to Screen";
     }
     else if (CurrentMode == LEDMode.Audio)
     {
         Logger.QueueLine("Switching LED Mode: Screen");
         CurrentMode = LEDMode.Screen;
         aColors.wi.StopRecording();
         sColors = new ScreenColors();
         aColors = null;
         DrawTimer.Start();
         buttonSwitch.Content = "_Switch to Audio";
     }
 }