private void btnAdd_Click(object sender, EventArgs e) { if (TextIsValid(txtDependant.Text) && TextIsValid(txtIndependant.Text)) { if (!Valid()) { return; } var newPair = new ProcessPair(new LoadedProcess(txtDependant.Text), new LoadedProcess(txtIndependant.Text)); newPair.ReLaunch = relaunchBox.Checked; newPair.StopProcess = stopProcessBox.Checked; ProcessList.Add(newPair); SaveProcessToFile(); newPair.WatchForStart(); newPair.WatchForEnd(); BindTable(); } }