/// <summary>
        /// identify the screen with the given id
        /// </summary>
        /// <param name="id">the id of the screen to identify</param>
        /// <param name="timeout">for how long to show the ui</param>
        public static void IdentifyScreen(int id, int timeout = 5000)
        {
            //bounds check
            if (id < 0 || id >= Screen.AllScreens.Length)
            {
                return;
            }

            //show ui
            ScreenIdentifierUI ui = new ScreenIdentifierUI(id);

            ui.Show();

            //hide ui after timeout
            Task.Run(async() =>
            {
                await Task.Delay(timeout);
                ui.Invoke(new MethodInvoker(() =>
                {
                    ui.Close();
                }));
            });
        }
Ejemplo n.º 2
0
 /// <summary>
 /// identify screens button clicked, show screen identification ui
 /// </summary>
 void OnIdentifyScreenIds(object sender, EventArgs e)
 {
     ScreenIdentifierUI.IdentifyAllScreens();
 }