Beispiel #1
0
        public void Join(int words = 1, bool saveWork = false)
        {
            var index = Container.Words.IndexOf(this) + 1;

            for (var i = 0; i < words; i++)
            {
                if (index < Container.Words.Count)
                {
                    var nextWord = Container.Words[index];
                    if (!String.IsNullOrWhiteSpace(nextWord.Wylie))
                    {
                        Wylie += " " + nextWord.Wylie;
                    }
                    if (saveWork)
                    {
                        if (!String.IsNullOrWhiteSpace(nextWord.English))
                        {
                            English += " " + nextWord.English;
                        }

                        Candidates.CrossJoin(nextWord.Candidates);

                        if (!String.IsNullOrWhiteSpace(nextWord.Commentary))
                        {
                            Commentary += "\n" + nextWord.Commentary;
                        }
                    }
                }
                Container.Words.RemoveAt(index);
            }
        }