예제 #1
0
        // Methods
        public string StartUp(MainWindow mainWindow)//Canvas artCanvas)
        {
            string LGSresult = "";

            if (LogitechGSDK.LogiLedInitWithName("Wave RGB"))
            {                                       //if no error...
                System.Threading.Thread.Sleep(250); //wait for LGS to wake up
                int[] version = GetLGSversion();
                if (version[0] == -1)
                {
                    LGSresult = "Successfully connected to LogiLED but version unknown.";
                }
                else
                {
                    LGSresult = string.Format($"Successfully connected to LogiLED version {version[0]}.{version[1]}.{version[2]}.");
                }
            }
            else
            {
                LGSresult = "Failed to connect to LogiLED.";
            }
            settingsWindow = new SettingsWindow(this);
            settingsWindow.SetupBackgroundsMenu(KeyboardBackgroundImageNames);
            settingsWindow.SetupPresetsMenu(presetNames);
            LoadPreferences();
            KeyListener.StartKeyListener(this);
            this.mainWindow = mainWindow;
            SetupTrayIcon();

            paintPeripheralsOnce = true;

            return(LGSresult);
        }
예제 #2
0
 public void TerminateApp()
 {
     KeyListener.StopKeyListener();
     theApp.HaltAnimation();
     theApp.StopLGS();
     theApp.WindowClosing(); // closes settings window and other clean up
     Close();
     Application.Current.Shutdown();
 }
예제 #3
0
 // Methods
 public string StartUp()
 {
     if (LogitechGSDK.LogiLedInitWithName("Wave RGB"))
     {                                       //if no error...
         System.Threading.Thread.Sleep(250); //wait for LGS to wake up
         LoadPreferences();
         KeyListener.StartKeyListener(this);
         int[] version = LGSversion();
         if (version[0] == -1)
         {
             return("Successfully connected to LGS but version unknown.");
         }
         else
         {
             return(string.Format($"Successfully connected to LGS version {version[0]}.{version[1]}.{version[2]}."));
         }
     }
     else
     {
         return("Failed to connect to LGS.");
     }
 }
예제 #4
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     KeyListener.StopKeyListener();
     theApp.HaltAnimation();
     theApp.StopLGS();
 }