refresh the form instead of doing full do-events. Much, much quicker that way.

This commit is contained in:
Tim Young 2018-10-05 10:45:30 -05:00
parent fbfc1e148b
commit b4e828162a

View File

@ -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();
}
/// <summary>