private void UpdateState() { while (true) { overlay_data.Update(); if (overlay_form.dev.GraphicsDeviceStatus == Microsoft.Xna.Framework.Graphics.GraphicsDeviceStatus.Lost) { overlay_form.Invoke(new MethodInvoker(delegate { overlay_form.Close(); })); overlay_form = new OverlayForm(screens[settings.Screen], overlay_data); overlay_form.Show(); } Thread.Sleep(50); } }
private void ManagerForm_FormClosed(object sender, FormClosedEventArgs e) { refresher.Abort(); timer.Stop(); overlay_form?.Close(); }