Example #1
0
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            if (mainLoop.IsBusy)
            {
                closePending = true;
                mainLoop.CancelAsync();
                e.Cancel = true;
                Hide();
                return;
            }

            MysticLightSDK.Shutdown();
            LogitechGSDK.Shutdown();

            base.OnFormClosing(e);
        }
Example #2
0
        private void BtnStop_Click(object sender, EventArgs e)
        {
            if (mainLoop.IsBusy)
            {
                NumBoxX.Enabled     = true;
                NumBoxY.Enabled     = true;
                NumBoxScale.Enabled = true;
                ComboRes.Enabled    = true;

                if (MysticLightSDK.Ready())
                {
                    MysticLightSDK.Shutdown();
                }

                if (LogitechGSDK.Ready())
                {
                    LogitechGSDK.Shutdown();
                }

                mainLoop.CancelAsync();
                StatusLabel.Text = "Stopped.";
            }
            LightsOff();
        }