Example #1
0
        public void AddWord()
        {
            WordEditForm wef = new WordEditForm();

            wef.SetEditMode(EditMode.Append);
            if (wef.ShowDialog() == DialogResult.OK)
            {
                DictItem di = new DictItem();
                di.Caption = wef.Caption;
                di.ReadValues(wef.Values);
                WordSet.Instance().Add(di);
                listView.Items.Add(new ListViewItem(di.Caption));
            }
        }
Example #2
0
        public void EditWord()
        {
            WordEditForm wef = new WordEditForm();

            wef.SetEditMode(EditMode.Update);
            wef.Caption = WordSet.Instance().CurrentItem.Caption;
            wef.AddValues(WordSet.Instance().CurrentItem.Values);

            if (wef.ShowDialog() == DialogResult.OK)
            {
                DictItem di = new DictItem();
                di.Caption = wef.Caption;
                di.UpdateValues(wef.Values);
                WordSet.Instance().Update(di);
            }
        }