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

            var pages = CreatePagesFromFiles(files);

            return SetParentSectionAndNotebook(pages, section);
        }
示例#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;
        }
示例#3
0
 private void OnSectionSelected(SectionSelected message)
 {
     _selectedSection = message.Section;
 }
示例#4
0
 public void AddSection(SectionDto section)
 {
     Sections = Sections.Add(section);
 }
示例#5
0
        private ImmutableArray<PageDto> SetParentSectionAndNotebook(ImmutableArray<PageDto> pages, SectionDto section)
        {
            pages.ForEach(page =>
            {
                page.ParentSection = section;
                page.ParentNotebook = section.ParentNotebook;
            });

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

            return await GetPagesForSection(actor, section);
        }