From d4e206047cd4ff2d716f1373fb5e9f80980b75dc Mon Sep 17 00:00:00 2001 From: Tim Young Date: Mon, 24 Sep 2018 10:35:51 -0500 Subject: [PATCH] Able to click the test button when an item is selected for regression --- EduNetworkBuilder/ListBoxWindow.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/EduNetworkBuilder/ListBoxWindow.cs b/EduNetworkBuilder/ListBoxWindow.cs index 4173385..2ccf741 100644 --- a/EduNetworkBuilder/ListBoxWindow.cs +++ b/EduNetworkBuilder/ListBoxWindow.cs @@ -395,6 +395,8 @@ namespace EduNetworkBuilder btnReset.Visible = false; tbSearchBox.Visible = false; + btnOK.Text = "Test"; + PuzzleInfo pi; string shown_name; string puzzle_name = ""; @@ -437,11 +439,8 @@ namespace EduNetworkBuilder } if (selected != null && selected != "") { - foreach (object one in lbWindowData.Items) - { - if (one.ToString() == selected) - lbWindowData.SelectedItem = selected; - } + if(selectedIndex >=0 && selectedIndex <= lbWindowData.Items.Count) + lbWindowData.SelectedIndex = selectedIndex; } if (lbWindowData.SelectedIndex != -1) { @@ -628,9 +627,9 @@ namespace EduNetworkBuilder //We always add one since we are skipping the loopback device myNetDevice.EditDHCP(lbWindowData.SelectedIndex + 1, this); } - if (MyMode == LBContents.puzzles) + if (MyMode == LBContents.puzzles || MyMode == LBContents.regressiontest) { - //Just like pressing the OK button. We load the map + //Just like pressing the OK button. We load the map / process regression btnOK_Click(sender, e); } UpdateForm(); @@ -700,6 +699,8 @@ namespace EduNetworkBuilder UpdateForm(); } } + if (MyMode == LBContents.regressiontest) + UpdateForm(); } }