private void btnStart_Click(object sender, EventArgs e) { // Start Runtime var __args = new ExecuteArgs(); __args.__gateway_address = txtTargetIP.Text; __args.__gateway_port = txtTargetPort.Text; __args.__gateway_uname = txtTargetUname.Text; __args.__gateway_pwd = txtTargetPwd.Text; __args.__listen_address = txtSourceIP.Text; __args.__listen_port = txtSourcePort.Text; __args.__listen_uname = txtSourceUname.Text; __args.__listen_pwd = txtSourcePwd.Text; __args.__error_level = __error_level; __args.__auto_truncate = chkAutoTruncate.Checked; __execute.__start_up(__args); btnStop.Enabled = true; btnStart.Enabled = false; btnPatient.Enabled = true; btnDrug.Enabled = true; btnLocation.Enabled = true; btnPrescriber.Enabled = true; btnRx.Enabled = true; btnStore.Enabled = true; btnTQ.Enabled = true; btnPrescriber.Enabled = true; btnSave.Enabled = true; __listening = true; }
// Do the real work here - call delegates to update UI public void __start_up(ExecuteArgs __args) { try { __logger = LogManager.GetLogger("GatewayTester.Main"); __update_event_ui("Proxy Tester Starting Up"); __p = new motSocket(__args.__gateway_address, Convert.ToInt32(__args.__gateway_port)); __update_event_ui(string.Format("Listening on: {0}:{1}, Sending to: {2}:{3}", __args.__listen_address, __args.__listen_port, __args.__gateway_address, __args.__gateway_port)); } catch (Exception e) { __update_error_ui(string.Format("Failed to start on {0}:{1}, Error: {2}", __args.__listen_address, __args.__listen_port, e.Message)); __logger.Log(__log_level, "Failed to start on {0}:{1}, Error: {2}", __args.__listen_address, __args.__listen_port, e.Message); } }