/*Generates a new bst with the random vertices created by the previous method*/ private void btnGenRan_Click(object sender, EventArgs e) { BST_visualizer newBstVis = new BST_visualizer(); lblInfo.Text = "Done!"; newBstVis.createSearchTree(generateRandomNodesList()); newBstVis.Show(); previousForm.Hide(); this.Close(); }
/*Creates(or not) a bst after making the necessary validations when the user clicks on the 'generate' button*/ private void btnDone_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(inputNumbers.Text.ToString())) { lblInfo.Text = "You haven't entered any numbers yet."; } else if (commaAmmountVerifier() && !otherVerifiers() && numberAmmountVerifier()) { BST_visualizer newBstVis = new BST_visualizer(); lblInfo.Text = "Done!"; newBstVis.createSearchTree(numberArray); newBstVis.changeTitleText(); newBstVis.Show(); previousForm.Hide(); this.Close(); } else { lblInfo.Text = "Please verify the data you are trying to submit."; ammountOfNumbers = 0; commaCounter = 0; } }