private void dicToolStripMenuItem_Click(object sender, EventArgs e) { for (int i = 2; i < 6; i++) { if (!File.Exists(Application.StartupPath + "/dictionary" + i.ToString() + ".txt")) { MessageBox.Show("Missing dictionary " + i.ToString() + ".", "Missing Dictionary"); return; } } if (fDictionary == null) fDictionary = new frmDictionary(); if (fDictionary.ShowDialog() != DialogResult.OK) return; string s = fDictionary.listBox1.Items[fDictionary.listBox1.SelectedIndex].ToString(); char c = s[0]; byte b = (byte)Convert.ToInt32(s[2].ToString(), 16); b <<= 4; b += (byte)Convert.ToInt32(s[3].ToString(), 16); rtEdit.Text = rtEdit.Text.Insert(rtEdit.SelectionStart, "<REF " + c + " " + b.ToString("X") + ">"); }
void setBles(bool b) { panel1.Enabled = b; saveToolStripMenuItem.Enabled = b; searchWordToolStripMenuItem.Enabled = b; dumpDictionaryToolStripMenuItem.Enabled = b; dicToolStripMenuItem.Enabled = b; if (!b) { fSearch = null; fDictionary = null; } }