Пример #1
0
        public void ReplaceWord(MasterWord originalWord, MasterWord replacement)
        {
            RemoveWord(originalWord);
            AddWord(replacement);

            // Apparently doing it only on the book, then saving MasterWord will update everything correctly
            // replacement.AddBook(this);
        }
Пример #2
0
        public Word(MasterWord masterWord, string text, Language language, string article = "")
        {
            MasterWord = masterWord;
            Text       = text;
            Language   = language;
            Article    = article;

            masterWord.Words.Add(this);
        }
Пример #3
0
        public void AddWord(MasterWord word)
        {
            if (_BookWordCollection.Any(bw => bw.MasterWordId == word.ID || bw.MasterWord == word))
            {
                return;
            }

            _BookWordCollection.Add(new BookWord()
            {
                Book = this, BookId = ID, MasterWord = word, MasterWordId = word.ID
            });
        }
Пример #4
0
 public void RemoveWord(MasterWord word) => RemoveWord(word.ID);