Example #1
0
        static public Tuple <Entry, IEnumerable <Word> > Create(IWin32Window owner, IHost host)
        {
            EntryDialog dialog = new EntryDialog(host);

            if (dialog.ShowDialog(owner) == DialogResult.OK)
            {
                return(dialog.OnCommitObject());
            }

            return(null);
        }
        void AddEntry()
        {
            Tuple <Entry, IEnumerable <Word> > adding = EntryDialog.Create(this, host);

            if (adding != null)
            {
                if (filter.In(adding.Item1, adding.Item2))
                {
                    entries.Add(adding.Item1);
                    foreach (Word word in adding.Item2)
                    {
                        words.Add(word);
                        SetSpellCheck(word, SpellCheck.None);
                        CheckSpellWord(word);
                    }
                }

                DoLessonContentModified(new Lesson[] { adding.Item1.Lesson });
                DoWordTypeContentModified(new WordType[] { adding.Item2.First().WordType });
            }
        }