private void ShowInfo(string a_information, TexBox texBox, Button addButton, Button clearButton, Window window) { Console.WriteLine(a_information); Console.WriteLine("---------------------------------"); Console.WriteLine(string.Format("{0} - Text: '{1}'", texBox.Name, texBox.Text)); Console.WriteLine(string.Format("{0} - Text: '{1}'", window.Name, window.Text)); Console.WriteLine(string.Format("{0} - Enabled: {1}", addButton.Name, addButton.Enabled)); Console.WriteLine(string.Format("{0} - Enabled: {1}", clearButton.Name, clearButton.Enabled)); Console.WriteLine(); }
public void Mediator_ControlsRelationTest() { Mediator m = new Mediator(); TexBox texBox = new TexBox(m, ControlName.TextBox); Button addButton = new Button(m, ControlName.PrzyciskDodaj); Button clearButton = new Button(m, ControlName.PrzycisWyczysc); Window window = new Window(m, ControlName.Okno); clearButton.ButtonClick(); ShowInfo("Wciśnięcie przycisku Wyczyść:", texBox, addButton, clearButton, window); texBox.TextWriting("Tekst został wprowadzony."); ShowInfo("Wprowadzenie tekstu:", texBox, addButton, clearButton, window); addButton.ButtonClick(); ShowInfo("Wciśnięcie przycisku Dodaj:", texBox, addButton, clearButton, window); }
private void button1_Click(object sender, EventArgs e) { //When button is clicked, run printStuff() from the class Run run.printStuff(); //Get string array named output from the class "Run" string[] output = run.output; //Clear TextBox TexBox.Clear(); //Print every string inside output for (int i = 0; i < output.Length; i++) { if (output[i] != null) { TexBox.AppendText(output[i]); } TexBox.AppendText(Environment.NewLine); } }