private void OpenOrderUI(int s) { try { UpLoad upload = new UpLoad(mWebsocket); if (Form1.dic_upLoad.Count > 0) { foreach (KeyValuePair <string, UpLoad> kv in Form1.dic_upLoad)//关闭其他窗口并移除 { kv.Value.Close(); kv.Value.Dispose(); websocket w = new websocket(); UpLoad u = new UpLoad(w); Form1.dic_upLoad.TryRemove(kv.Key, out u); } } string str = ""; Form1.dic_upLoad.TryAdd(str, upload); upload.Show(); } catch (Exception ex) { IniHelper.WriteLog(ex); return; } }
/// <summary> /// 打开订单新窗口 /// </summary> /// <param name="orderid"></param> private void OpenUpload(string orderid) { UpLoad upload = new UpLoad(mWebsocket); if (Form1.dic_upLoad.Count > 0) { foreach (KeyValuePair <string, UpLoad> kv in Form1.dic_upLoad)//关闭其他窗口并移除 { kv.Value.Close(); kv.Value.Dispose(); websocket w = new websocket(); UpLoad u = new UpLoad(w); Form1.dic_upLoad.TryRemove(kv.Key, out u); } } Form1.dic_upLoad.TryAdd(orderid, upload); upload.Show(); }
/// <summary> /// F5刷新网页 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void gHook_KeyDown(object sender, KeyEventArgs e) { if (this.ContainsFocus) { if (e.KeyValue == 116) { wb.GetBrowser().Reload(); } else if (e.KeyValue == 117) { try { UpLoad upload = new UpLoad(mWebsocket); if (Form1.dic_upLoad.Count > 0) { foreach (KeyValuePair <string, UpLoad> kv in Form1.dic_upLoad)//关闭其他窗口并移除 { kv.Value.Close(); kv.Value.Dispose(); websocket w = new websocket(); UpLoad u = new UpLoad(w); Form1.dic_upLoad.TryRemove(kv.Key, out u); } } string str = ""; Form1.dic_upLoad.TryAdd(str, upload); upload.Show(); } catch (Exception ex) { IniHelper.WriteLog(ex); return; } } } }