コード例 #1
0
 public void Remove(WordViewModel word)
 {
     Debug.Assert(word.Thing.MajorWord != word);
     this.Words.Collection.Remove(word);
     word.Thing.Words.Remove(word);
     word.Thing.Source.Words.Remove(word.Source);
     word.Thing.Update();
 }
コード例 #2
0
        public void Build(WordViewModel word, IWordBuilder builder)
        {
            Debug.Assert(word != null);
            Debug.Assert(builder != null);

            foreach (var retWord in builder.Build(word.Thing, word))
            {
                word.Thing.Source.Words.Add(retWord);
                var pinyinModel = new WordViewModel(word.Thing, retWord);
                word.Thing.Words.Add(pinyinModel);
                this.Words.Collection.Insert(this.Words.Collection.IndexOf(word) + 1, pinyinModel);
            }
            word.Thing.Update();
        }