private void loadFromBinFileToolStripMenuItem_Click(object sender, EventArgs e) { if (openFileDialogDict.ShowDialog() == DialogResult.OK) { try { DateTime old = DateTime.Now; m_DictFile = Dict.LoadFromBinFile(openFileDialogDict.FileName); TimeSpan s = DateTime.Now - old; statusStrip.Items[0].Text = s.TotalMilliseconds.ToString() + "ms"; } catch (Exception e1) { MessageBox.Show(String.Format("Can not open dictionary, errmsg:{0}", e1.Message)); return; } panelMain.Enabled = true; m_DictManage.Dict = m_DictFile; m_DictFileName = openFileDialogDict.FileName; this.Text = openFileDialogDict.FileName; ShowCount(); } }
public void ShowDialog(String fileName, DictManage.DictMgr dictMgr) { m_NameTableName = fileName; m_DictMgr = dictMgr; try { m_DictFile = Dict.LoadFromBinFileEx(fileName); } catch (Exception e1) { MessageBox.Show(String.Format("Can not open dictionary, errmsg:{0}", e1.Message)); return; } m_DictManage.Dict = m_DictFile; this.ShowDialog(); }
private void loadFromTextFileToolStripMenuItem_Click(object sender, EventArgs e) { if (openFileDialogDict.ShowDialog() == DialogResult.OK) { try { m_DictFile = Dict.LoadFromTextDict(openFileDialogDict.FileName); } catch (Exception e1) { MessageBox.Show(String.Format("Can not open dictionary, errmsg:{0}", e1.Message)); return; } panelMain.Enabled = true; m_DictManage.Dict = m_DictFile; m_DictFileName = openFileDialogDict.FileName; this.Text = openFileDialogDict.FileName; ShowCount(); } }