public IBrowser CreateGroupBrowser(BookGroup bookGroup)
 {
     var childGroups = _bibleMetadataService.GetChildGroups(bookGroup.Name);
     if (childGroups.Any())
     {
         return new GroupBrowser(bookGroup, childGroups.Select(x => x.Name));
     }
     else
     {
         var books = _bibleMetadataService.GetBooks(bookGroup.Name);
         return new GroupBrowser(bookGroup, books.Select(x => x.Name));
     }
 }
        private char GetCollectionId(BookGroup group)
        {
            if (group.Parent == BookGroup.EntireBible)
            {
                if (group == BookGroup.OldTestament)
                {
                    return 'O';
                }
                if (group == BookGroup.NewTestament)
                {
                    return 'N';
                }
                throw new Exception(string.Concat("Unexpected book group: ", group.Name));
            }

            return GetCollectionId(group.Parent);
        }
예제 #3
0
 public GroupBrowser(BookGroup bookGroup, IEnumerable<string> optionsInGroup)
     : base(bookGroup.GetTopmostAncestor().Name)
 {
     _bookGroup = bookGroup;
     _options = optionsInGroup.ToList();
 }