private void Btn_Start_Click(object sender, EventArgs e) { HandleDelegate task1 = GetListBoxItems1; task1.BeginInvoke(null, null); HandleDelegate task2 = GetListBoxItems2; task2.BeginInvoke(null, null); }
private void Btn_start_Click(object sender, EventArgs e) { b2.BackColor = Color.Yellow; b5_1.BackColor = Color.Yellow; b5_2.BackColor = Color.Yellow; b6.BackColor = Color.Yellow; b7.BackColor = Color.Yellow; b8.BackColor = Color.Yellow; //开始自检 HandleDelegate task = Start_Click; task.BeginInvoke(null, Btn_start); listBox1.Items.Clear(); }
private void Btn_Start_Click(object sender, EventArgs e) { //HandleDelegate task = Start_Click; //task.BeginInvoke(null, null); HandleDelegate task1 = GetListBoxItems1; task1.BeginInvoke(null, null); HandleDelegate task2 = GetListBoxItems2; task2.BeginInvoke(null, null); HandleDelegate task3 = GetListBoxItems3; task3.BeginInvoke(null, null); HandleDelegate task4 = GetListBoxItems4; task4.BeginInvoke(null, null); }
public override void handlePOSTRequest(HttpProcessor p, StreamReader inputData) { Config config = new Config(); string priterNameConfig = config.ReadString("printer", "print", null); if (priterNameConfig == null || priterNameConfig.Length == 0) { p.writeSuccess("application/json"); Response res = new Response(); res.stauts = ResStatusCode.NO_Printer.ToString(); res.desc = "请先设置打印面单机器"; string json = JsonConvert.SerializeObject(res); p.outputStream.WriteLine(json); } else { HandleDelegate handleDelegate = asynHandle; string data = inputData.ReadToEnd(); try { Console.WriteLine("======data===========================" + data); JArray item = (JArray)JsonConvert.DeserializeObject(data); IAsyncResult result = handleDelegate.BeginInvoke(item, null, null); p.writeSuccess("application/json"); Response res = new Response(); res.stauts = ResStatusCode.Success.ToString(); string json = JsonConvert.SerializeObject(res); p.outputStream.WriteLine(json); } catch (Newtonsoft.Json.JsonReaderException e) { p.writeSuccess("application/json"); Response res = new Response(); res.stauts = ResStatusCode.Forma_Error.ToString(); res.desc = "数据格式错误"; string json = JsonConvert.SerializeObject(res); p.outputStream.WriteLine(json); } } }
private void Start_Click() { b1_f1.BackColor = Color.Yellow; b1_f2.BackColor = Color.Yellow; b1_f3.BackColor = Color.Yellow; b1_f4.BackColor = Color.Yellow; HandleDelegate task1 = Start_FJ1; task1.BeginInvoke(null, null); HandleDelegate task2 = Start_FJ2; task2.BeginInvoke(null, null); HandleDelegate task3 = Start_FJ3; task3.BeginInvoke(null, null); HandleDelegate task4 = Start_FJ4; task4.BeginInvoke(null, null); b4_1.BackColor = Color.Yellow; b4_2.BackColor = Color.Yellow; b4_3.BackColor = Color.Yellow; b4_4.BackColor = Color.Yellow; HandleDelegate task5 = Start_Replenishment1; task5.BeginInvoke(null, null); HandleDelegate task6 = Start_Replenishment2; task6.BeginInvoke(null, null); HandleDelegate task7 = Start_Replenishment3; task7.BeginInvoke(null, null); HandleDelegate task8 = Start_Replenishment4; task8.BeginInvoke(null, null); b3_1.BackColor = Color.Yellow; b3_2.BackColor = Color.Yellow; b3_3.BackColor = Color.Yellow; b3_4.BackColor = Color.Yellow; HandleDelegate task9 = Start_InOut1; task9.BeginInvoke(null, null); HandleDelegate task10 = Start_InOut2; task10.BeginInvoke(null, null); HandleDelegate task11 = Start_InOut3; task11.BeginInvoke(null, null); HandleDelegate task12 = Start_InOut4; task12.BeginInvoke(null, null); HandleDelegate task13 = Start_HJStorage1; task13.BeginInvoke(null, null); HandleDelegate task14 = Start_HJStorage2; task14.BeginInvoke(null, null); }