// // This example shows how to wait for a device to be connected or disconnected // void ScriptMain() { while (true) { Console.WriteLine("Waiting for device... (click on 'Request Abort' to stop this script)"); // Wait for a device to be connected Sync.SleepUntil(() => MainForm.HasDevice); Console.WriteLine("Device found!"); Console.WriteLine("Waiting for device to be disconnected... (click on 'Request Abort' to stop this script)"); // Wait for the device to be disconnected Sync.SleepUntil(() => !MainForm.HasDevice); } }