Example #1
0
        private async void btTest_Click(object sender, EventArgs e)
        {
            btnCancel.Enabled = false;
            btnSave.Enabled   = false;
            btTest.Enabled    = false;
            try
            {
                using (Global_GUI.CursorWait cw = new Global_GUI.CursorWait())
                {
                    Global.Log("------ TESTING TRIGGERS --------");

                    bool result = await AITOOL.Trigger(cam, null, true);

                    Global.Log("------ DONE TESTING TRIGGERS --------");

                    if (result)
                    {
                        MessageBox.Show($"Succeeded! See log for details.", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show($"Failed. See log for details.", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
            catch { }
            finally
            {
                btnCancel.Enabled = true;
                btnSave.Enabled   = true;
                btTest.Enabled    = true;
            }
        }