From b4e828162a809ee722b3575cdbccee834aef2344 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Fri, 5 Oct 2018 10:45:30 -0500 Subject: [PATCH] refresh the form instead of doing full do-events. Much, much quicker that way. --- EduNetworkBuilder/ListBoxWindow.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/EduNetworkBuilder/ListBoxWindow.cs b/EduNetworkBuilder/ListBoxWindow.cs index 51979db..c82ff13 100644 --- a/EduNetworkBuilder/ListBoxWindow.cs +++ b/EduNetworkBuilder/ListBoxWindow.cs @@ -524,6 +524,7 @@ namespace EduNetworkBuilder } else if (MyMode == LBContents.regressiontest) { + Console.WriteLine(" Test button pressed at " + DateTime.UtcNow.ToString()); if (lbWindowData.SelectedItem is MyPuzzleEntry) { MyPuzzleEntry MPE = (MyPuzzleEntry)lbWindowData.SelectedItem; @@ -532,10 +533,14 @@ namespace EduNetworkBuilder BuilderWindow myWin = (BuilderWindow)Application.OpenForms["BuilderWindow"]; if (myWin != null) { + Console.WriteLine(" Testing for replay at " + DateTime.UtcNow.ToString()); + if (oursettings.HasReplay(TheName)) { + Console.WriteLine(" Replay found at " + DateTime.UtcNow.ToString()); //myWin.Activate(); FormColorForTesting(); + Console.WriteLine(" Coloring finished at " + DateTime.UtcNow.ToString()); myWin.replayNetwork(TheName, 1); //Return back to the listbox window Visible = true; @@ -558,17 +563,18 @@ namespace EduNetworkBuilder private void FormColorForTesting() { this.BackColor = Color.GreenYellow; - Application.DoEvents(); + Refresh(); } private void FormColorBackToNormal() { this.BackColor = SystemColors.Control; - Application.DoEvents(); + + Refresh(); } private void FormColorContinuingLoop() { this.BackColor = Color.DarkGray; - Application.DoEvents(); + Refresh(); } ///