Example #1
0
        private ImmutableArray<PageDto> GetPages(SectionDto section)
        {
            var files = GetFilesUnderDirectory(section.Directory);

            var pages = CreatePagesFromFiles(files);

            return SetParentSectionAndNotebook(pages, section);
        }
Example #2
0
        public async Task<ImmutableArray<PageDto>> GetPagesForSection(IActorRef actor, SectionDto section)
        {
            var answer = await actor.Ask(new PageActor.GetPagesForSection(section));

            if (answer is PageActor.GetPagesForSectionResult)
            {
                var result = answer as PageActor.GetPagesForSectionResult;

                return result.Pages;
            }

            LogFailure(answer);

            return ImmutableArray<PageDto>.Empty;
        }
Example #3
0
 private void OnSectionSelected(SectionSelected message)
 {
     _selectedSection = message.Section;
 }
Example #4
0
 public void AddSection(SectionDto section)
 {
     Sections = Sections.Add(section);
 }
Example #5
0
        private ImmutableArray<PageDto> SetParentSectionAndNotebook(ImmutableArray<PageDto> pages, SectionDto section)
        {
            pages.ForEach(page =>
            {
                page.ParentSection = section;
                page.ParentNotebook = section.ParentNotebook;
            });

            return pages;
        }
Example #6
0
 public GetPagesForSection(SectionDto section)
 {
     Section = section;
 }
Example #7
0
 public SectionSelected(SectionDto section)
 {
     Section = section;
 }
Example #8
0
 public void AddSection(SectionDto section)
 {
     Sections = Sections.Add(section);
 }
Example #9
0
        public async Task<ImmutableArray<PageDto>> GetPagesForSection(SectionDto section)
        {
            var actor = ActorSystem.ActorOf(ActorRegistry.Page);

            return await GetPagesForSection(actor, section);
        }