Exemple #1
0
        public static void CreateSampleProjectIfNeeded()
        {
            if (File.Exists(SampleProjectFilePath))
            {
                return;
            }
            var sampleMetadata = new GlyssenDblTextMetadata();

            sampleMetadata.AvailableBooks = new List <Book>();
            var bookOfMark = new Book();

            bookOfMark.Code            = "MRK";
            bookOfMark.IncludeInScript = true;
            bookOfMark.LongName        = "De Good Nyews Bout Jedus Christ Wa Mark Write";
            bookOfMark.ShortName       = "Mark";
            bookOfMark.Abbreviation    = "Mr";
            sampleMetadata.AvailableBooks.Add(bookOfMark);
            sampleMetadata.FontFamily       = "Times New Roman";
            sampleMetadata.FontSizeInPoints = 12;
            sampleMetadata.Id        = kSample;
            sampleMetadata.Copyright = Copyright;
            sampleMetadata.Promotion = Promotion;
            sampleMetadata.Language  = new GlyssenDblMetadataLanguage {
                Iso = kSample
            };
            sampleMetadata.Identification = new DblMetadataIdentification {
                Name = kSampleProjectName, NameLocal = kSampleProjectName
            };
            sampleMetadata.ProjectStatus.ProjectSettingsStatus = ProjectSettingsStatus.Reviewed;
            sampleMetadata.ProjectStatus.QuoteSystemStatus     = QuoteSystemStatus.Obtained;
            sampleMetadata.ProjectStatus.BookSelectionStatus   = BookSelectionStatus.Reviewed;

            var sampleWs = new WritingSystemDefinition();

            sampleWs.QuotationMarks.AddRange(GetSampleQuoteSystem().AllLevels);

            XmlDocument sampleMark = new XmlDocument();

            sampleMark.LoadXml(Resources.SampleMRK);
            UsxDocument mark = new UsxDocument(sampleMark);

            new Project(sampleMetadata, new[] { mark }, SfmLoader.GetUsfmStylesheet(), sampleWs);
        }
Exemple #2
0
 /// <summary>
 /// Try to get the book as a UsxDocument
 /// </summary>
 /// <returns>True if the book exists, false otherwise</returns>
 public bool TryGetBook(string bookId, out UsxDocument book)
 {
     return(m_books.TryGetValue(bookId, out book));
 }
        public void BookId_GetsBookIdFromBookNode()
        {
            var usxDocument = new UsxDocument(CreateMarkOneDoc(string.Empty));

            Assert.AreEqual("MRK", usxDocument.BookId);
        }
        public static XmlNodeList GetChaptersAndParasForMarkOneContaining2Verses()
        {
            var usxDocument = new UsxDocument(CreateMarkOneDoc(kParaNodeText));

            return(usxDocument.GetChaptersAndParas());
        }