Ejemplo n.º 1
0
        public void Init(int bookNumber, string chapterAndVersesString)
        {
            Verses.Clear();

            using (var reader = new BibleTextReader(_optionsService.EpubPath))
            {
                var formattingOptions = new FormattingOptions
                {
                    IncludeVerseNumbers = false,
                    ShowBreakInVerses   = false,
                    TrimPunctuation     = _optionsService.TrimPunctuation,
                    TrimQuotes          = _optionsService.TrimQuotes,
                    UseTildeSeparator   = _optionsService.UseTildeMarker
                };

                var verses = reader.ExtractVerseTextArray(
                    bookNumber,
                    chapterAndVersesString,
                    formattingOptions);

                var epubPath = _optionsService.EpubPath;

                foreach (var vs in verses)
                {
                    var modifiedText = _verseEditorService.Get(epubPath, vs.BookNumber, vs.ChapterNumber, vs.VerseNumber);

                    var verseText = new EditVerseTextViewModel
                    {
                        EpubPath          = epubPath,
                        BookNumber        = vs.BookNumber,
                        Chapter           = vs.ChapterNumber,
                        Verse             = vs.VerseNumber,
                        OriginalVerseText = vs.Text,
                        ModifiedVerseText = modifiedText ?? vs.Text
                    };

                    Verses.Add(verseText);
                }
            }
        }
Ejemplo n.º 2
0
        private void AddDesignTimeItems()
        {
            if (IsInDesignMode)
            {
                var mockVerseText = LoremIpsum.GetSomeMockVerses();

                for (int n = 0; n < mockVerseText.Length; ++n)
                {
                    var item = new EditVerseTextViewModel
                    {
                        BookName          = @"Book",
                        BookNumber        = 1,
                        Chapter           = 1,
                        Verse             = n + 1,
                        OriginalVerseText = mockVerseText[n],
                        ModifiedVerseText = mockVerseText[n]
                    };

                    Verses.Add(item);
                }
            }
        }