//Stop all running threads and switchers
        private void MainInterface_FormClosing(object sender, FormClosingEventArgs e)
        {
            InputDataTimer.Stop();
            ImageUpdateTimer.Stop();
            Log.Info("Update timers stopped.");

            robotThread.StopAsync();
            cameraThread.StopAsync();
            inputThread.StopAsync();
            controlsThread.StopAsync();

            robotThread.Stop();
            cameraThread.Stop();
            inputThread.Stop();
            controlsThread.Stop();
            Log.Info("All threads stopped.");

            Log.Stop();
        }
Ejemplo n.º 2
0
        public void Stop()
        {
            if (!Started)
            {
                throw new Exception("WebWallpaper is not started");
            }
            Logger.Log("Stopping...");

            renderThread.Stop();
            renderThread.Wait();

            inputThread.Stop();
            inputThread.Wait();

            Controller.HideTrayIcon();

            Application.Exit();

            Started = false;
        }