public RemoteObject(int nForm, int nInternalForm, int nValue1, string strSampleID) { Process[] processes = Process.GetProcessesByName("PDLRT"); foreach (Process p in processes) { IntPtr hwnd = p.MainWindowHandle; switch (nInternalForm) { case 1: InterfaceTest_Form interfaceTestForm = new InterfaceTest_Form(); interfaceTestForm.ShowDialog(new WindowWrapper(hwnd)); interfaceTestForm.Close(); break; case 2: Routing_Form routingForm = new Routing_Form(nValue1); routingForm.ShowDialog(new WindowWrapper(hwnd)); routingForm.Close(); break; case 3: TimeForAlarmForm alarmForm = new TimeForAlarmForm(); alarmForm.ShowDialog(new WindowWrapper(hwnd)); alarmForm.Close(); break; case 4: SampleListTGA TGAListForm = new SampleListTGA(); TGAListForm.ShowDialog(new WindowWrapper(hwnd)); TGAListForm.Close(); break; case 5: _pipeClient = new PipeClient(); _pipeClient.Send("RobotRemoteForm", "LMPipe", 1000); _pipeClient = null; break; } } }
private void cmdSend_Click(object sender, EventArgs e) { _pipeClient = new PipeClient(); timer1.Enabled = true; // _pipeClient.Send(txtMessage.Text + " - " + _ctr.ToString(), "TestPipe", 1000); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { _pipeClient = null; }
private void RelaodRoutingTableData_Click(object sender, EventArgs e) { PipeClient _pipeClient; _pipeClient = new PipeClient(); _pipeClient.Send("ReloadRoutingTableData", "LMPipe", 1000); _pipeClient = null; }