private void newbtn_Click(object sender, EventArgs e) { lastpa = false; curchanum = -1; detectionpath = ""; detectionmode = new DetectionMode(); chanPara = new List <ClassChanpara>(); treechan = new Hashtable(); tree.TopNode.Nodes.Clear(); InitCommon(); InitGate(); }
private void namebox_SelectedIndexChanged(object sender, EventArgs e) { if (namebox.SelectedItem != null && isclick) { string filename = Application.StartupPath + @"\DetectionMode" + "\\" + Convert.ToString(namebox.SelectedItem) + ".xml"; try { treechan = (Hashtable)SystemConfig.ReadBase64Data(filename, "treechan"); chanPara = (List <ClassChanpara>)SystemConfig.ReadBase64Data(filename, "chanPara"); detectionmode = (DetectionMode)SystemConfig.ReadBase64Data(filename, "detectionmode"); LoadUT(); detectionpath = filename; } catch { MessageShow.show("Load Detection Mode error", "载入检测模式错误"); } } }
private void loadbtn_Click(object sender, EventArgs e) { OpenFileDialog bsLoadDialog = new OpenFileDialog(); string filepath = Application.StartupPath + @"\DetectionMode"; bsLoadDialog.Filter = "xml文件(*.xml)|*.xml|所有文件(*.*)|*.*"; if (!Directory.Exists(filepath)) { try { Directory.CreateDirectory(filepath); } catch { filepath = Application.StartupPath; } } bsLoadDialog.InitialDirectory = filepath; bsLoadDialog.FilterIndex = 1; if (bsLoadDialog.ShowDialog() == DialogResult.OK) { try { String filename = bsLoadDialog.FileName; treechan = (Hashtable)SystemConfig.ReadBase64Data(filename, "treechan"); chanPara = (List <ClassChanpara>)SystemConfig.ReadBase64Data(filename, "chanPara"); detectionmode = (DetectionMode)SystemConfig.ReadBase64Data(filename, "detectionmode"); LoadUT(); detectionpath = filename; } catch { MessageShow.show("Load Detection Mode error", "载入检测模式错误"); } } }
public void FormLoad() { string filename = "DetectionMode"; string filepath = SystemConfig.GlobalLoad(filename); if (filepath == "") { return; } try { treechan = (Hashtable)SystemConfig.ReadBase64Data(filepath, "treechan"); chanPara = (List <ClassChanpara>)SystemConfig.ReadBase64Data(filepath, "chanPara"); detectionmode = (DetectionMode)SystemConfig.ReadBase64Data(filepath, "detectionmode"); mainform.SetDetection(detectionmode); } catch { MessageShow.show("DetectionMode Load Error", "检测模式载入错误"); return; } detectionpath = filepath; }