Exemplo n.º 1
0
 private void ReadParagraph(Chapter chapter, XmlNode node)
 {
     Verse verse = null;
     bool isNewParagraph = true;
     foreach (XmlNode child in node.ChildNodes)
         switch (child.Name)
         {
             case "v":
                 verse = new Verse(chapter)
                 {
                     Number = GetAttributeInt(child, "id"),
                     IsParagraphStart = isNewParagraph,
                 };
                 chapter.Verses.Add(verse);
                 isNewParagraph = false;
                 break;
             case "w":
                 verse.Words.Add(ReadWord(verse, child));
                 break;
             case "add":
                 verse.Words.Add(ReadWord(verse, child, true));
                 break;
             case "#text":
                 if (verse != null)
                 {
                     verse.Words.Add(ReadWord(verse, child));
                 }
                 break;
             case "ve":
                 // Do nothing... Verse End marker
                 break;
         }
 }
Exemplo n.º 2
0
        public VerseMarkerView(Verse verse)
            : this()
        {
            uxTbVerseMarker.Text = string.Format("{0}:{1}", verse.Chapter.Number, verse.Number);

            if (verse.IsParagraphStart) {
                uxTbVerseMarker.FontWeight = FontWeights.Bold;
                uxTbVerseMarker.Background = Brushes.LightSeaGreen;
            }
            else {
                uxTbVerseMarker.Background = Brushes.LightBlue;
            }
        }
Exemplo n.º 3
0
        private Word ReadWord(Verse verse, XmlNode node, bool isAddedByTranslators = false)
        {
            Word word = new Word(verse)
            {
                Text = node.InnerText.Replace('\n', ' ').Trim(),        // Verses with 'LORD' have this - e.g. Gen 2:4
                IsAddedByTranslators = isAddedByTranslators,
                IsPunctuation = node.Name == "#text" && !char.IsLetterOrDigit(node.InnerText.Trim()[0]),
            };

            string strongsNumbers = GetAttribute(node, "s");
            if (strongsNumbers != null)
                word.StrongsNumbers = strongsNumbers.Split(' ');

            return word;
        }
Exemplo n.º 4
0
 public Word(Verse verse)
 {
     Verse = verse;
 }