public void StartTcptest(string jsondata) { if (jsondata.StartsWith("JobTest")) { TcpJobTest tct = JsonConvert.DeserializeObject <TcpJobTest>(jsondata.Remove(0, 7)); if (tct.JobName != null && tct.TransformerID != null) { Application.Current.Dispatcher.Invoke(() => { WindowTesting windowTesting = new WindowTesting(tct.TransformerID, tct.JobName, tct.Information, istcp: true); if (windowTesting.inited == true) { windowTesting.Show(); windowTesting.StartButton_Click(null, null); } }); } else { var temp = TcpTask.TcpServer._clients.ToArray(); foreach (var p in temp) { TcpTask.TcpServer.Send((TCPClientState)p, new byte[] { (int)Errorsymbol.StartTestFalse }); } } } }
private void NewTestButton_Click(object sender, RoutedEventArgs e) { if (TransformerListBox.SelectedIndex < 0) { return; } if (JobListBox.SelectedIndex < 0) { return; } WindowTesting windowTesting = new WindowTesting(TransformerListBox.SelectedItem.ToString(), JobListBox.SelectedItem.ToString(), new JobInformation()); if (windowTesting.inited == true) { windowTesting.ShowDialog(); } }