Exemplo n.º 1
0
 private void mnuPgSelectNone_Click(object sender, RoutedEventArgs e)
 {
     if (lstFileChapters.SelectedValue != null)
     {
         SelectableMangaChapter Chapter = (SelectableMangaChapter)lstFileChapters.SelectedValue;
         Chapter.Pages
         .ForEach(p => p.IsChecked = false);
     }
 }
Exemplo n.º 2
0
 private void mnuDeletePg_Click(object sender, RoutedEventArgs e)
 {
     if (lstFileChapters.SelectedValue != null)
     {
         SelectableMangaChapter Chapter   = (SelectableMangaChapter)lstFileChapters.SelectedValue;
         List <MangaPage>       tempPages = Chapter.Pages.Where(p => p.IsChecked).ToList();
         tempPages.ForEach(p => Chapter.Pages.Remove(p));
         Chapter.updateChapterStats();
     }
 }
Exemplo n.º 3
0
 private void mnuToDouble_Click(object sender, RoutedEventArgs e)
 {
     if (lstFileChapters.SelectedValue != null)
     {
         SelectableMangaChapter Chapter = (SelectableMangaChapter)lstFileChapters.SelectedValue;
         Chapter.Pages
         .Where(p => p.IsChecked)
         .ForEach(p => p.IsDouble = true);
         Chapter.updateChapterStats();
     }
 }
Exemplo n.º 4
0
 private void mnuToSingle_Click(object sender, RoutedEventArgs e)
 {
     //ListBoxAction<Core.MangaPage>(lstFilePages, page => { page.IsDouble = false; page.Chapter.updatePageNumber(); });
     if (lstFileChapters.SelectedValue != null)
     {
         SelectableMangaChapter Chapter = (SelectableMangaChapter)lstFileChapters.SelectedValue;
         Chapter.Pages
         .Where(p => p.IsChecked)
         .ForEach(p => p.IsDouble = false);
         Chapter.updateChapterStats();
     }
 }
Exemplo n.º 5
0
        private void LstFileChaptersBinding_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (!selectPrintChapters)
            {
                return;
            }
            if (e.AddedItems.Count == 0)
            {
                return;
            }


            SelectableMangaChapter c = (SelectableMangaChapter)e.AddedItems[0] ?? (SelectableMangaChapter)e.RemovedItems[0];

            selectPrintChapters = false;
            lstFileChaptersBinding.SelectedItem = c;
            selectPrintChapters = true;

            //unselect all
            selectPrintPages = false;
            foreach (var p in allPrintPages)
            {
                p.Selected = false;
            }

            bool pSelected = false;

            foreach (SelectablePrintPage p in allPrintPages)
            {
                if (
                    p.Front.Left.MangaPageSource?.Chapter.Name == c.Name ||
                    p.Front.Right.MangaPageSource?.Chapter.Name == c.Name ||
                    p.Back.Left.MangaPageSource?.Chapter.Name == c.Name ||
                    p.Back.Right.MangaPageSource?.Chapter.Name == c.Name
                    )
                {
                    p.Selected = true;
                    if (!pSelected)
                    {
                        pSelected = true;
                        lstPrintPages.ScrollIntoView(p);
                    }
                }
            }
            selectPrintPages = true;
        }