private void fromClipboardToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var text    = Clipboard.GetText();
            var lines   = Regex.Split(text, @"\r?\n|\r");
            var entries = lines
                          .Select(x => x.Split("\t"[0]))
                          .Where(x => x.Length >= 2)
                          .GroupBy(x => x[0])
                          .Select(x => x.First())
                          .ToDictionary(x => x[0], x => x[1])
            ;

            if (entries.Count == 0)
            {
                MessageBox.Show("Not supported format.");
                return;
            }

            var sb = new StringBuilder();

            foreach (var kv in entries.Take(Math.Min(lines.Length, 5)))
            {
                sb.AppendLine($"{kv.Key}\t{kv.Value}");
            }
            if (entries.Count > 5)
            {
                sb.AppendLine("...");
            }
            if (MessageBox.Show(sb.ToString(), "Preview", MessageBoxButtons.YesNo) != DialogResult.Yes)
            {
                return;
            }

            var dict = new PatternDictionary
            {
                Enable  = true,
                Entries = entries,
            };

            saveFileDialog1.InitialDirectory = DictionaryFolder;
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                dict.Path = saveFileDialog1.FileName;
                dict.Name = Path.GetFileNameWithoutExtension(saveFileDialog1.FileName);
                AddDictionary(dict);
            }

            using var frm = new DictionaryEditor(dict);
            var result = frm.ShowDialog();

            if (result == DialogResult.OK)
            {
                Dictionaries.Remove(dict);
                Dictionaries.Add(frm.Dict);
            }
        }
        private void tsmiDictionary_Click(object sender, EventArgs e)
        {
            var path = (string)((ToolStripMenuItem)sender).Tag;
            var dict = Dictionaries.First(x => x.Path == path);

            using var frm = new DictionaryEditor(dict);
            var result = frm.ShowDialog();

            if (result == DialogResult.OK)
            {
                Dictionaries.Remove(dict);
                Dictionaries.Add(frm.Dict);
            }
        }