private void GoChapter(int toGo) { CatalogGrid.Visibility = Visibility.Collapsed; SettingGrid.Visibility = Visibility.Collapsed; if (toGo > -1 && toGo <= config.ChaptersCount) { config.CurrentChapter = toGo; F**k.Document.Blocks.Clear(); F**k.AppendText(bookReading.titles[toGo]); if (bookReading.chapters[toGo].Length > config.DivideLimit && !config.ChapterDivide) { Paragraph graph = new Paragraph(); NovelContent.Blocks.Add(graph); Action action = new Action(() => { ReadText(graph, bookReading.chapters[toGo]); }); action.BeginInvoke(null, null); } else { F**k.AppendText(bookReading.chapters[toGo]); } F**k.Selection.Select(F**k.Document.ContentStart, F**k.Document.ContentStart); F**k.ScrollToHome(); wait = -config.WaitBefore; preOffSet = 0.0; F**k.Focus(); } else { GoChapter(0); } }
private void Default_Click(object sender, RoutedEventArgs e) { var flag = (!config.LongDivide || !config.ChapterDivide || config.Rg != "\\b第([0-9]{1,4}|[一二三四五六七八九十两百千零○〇廿卅卌]{1,7})[章节回]( .*)?(?=\\r\\n)" || 12800 != config.DivideLimit); config.BackToDefault(); if (flag) { OpenText(bookReading.filePath); } SettingGrid.Visibility = Visibility.Collapsed; F**k.Focus(); }
private void ChapterList_Click(object sender, RoutedEventArgs e) { if (CatalogGrid.Visibility == Visibility.Collapsed) { CatalogGrid.Visibility = Visibility.Visible; Catalog.ScrollIntoView(Catalog.Items[config.CurrentChapter]); Catalog.SelectedItem = Catalog.Items[config.CurrentChapter]; } else { CatalogGrid.Visibility = Visibility.Collapsed; } F**k.Focus(); }
private void ToNightMode_Click(object sender, RoutedEventArgs e) { if (!config.NightMode) { config.tempColor = config.BackgroundColor; MainGrid.Background = OtherGrid.Background = Catalog.Background = Shelf.Background = BookMark.Background = Brushes.Black; NovelContent.Foreground = Catalog.Foreground = Shelf.Foreground = BookMark.Foreground = Brushes.DimGray; config.BackgroundColor = "#323232"; } else { config.BackgroundColor = config.tempColor; NovelContent.Foreground = config.FontBrush; Catalog.Background = MainGrid.Background = Shelf.Background = BookMark.Background = OtherGrid.Background = Brushes.White; Catalog.Foreground = Shelf.Foreground = BookMark.Foreground = Brushes.Black; } config.NightMode = !config.NightMode; config.OnPropertyChanged("LabelColor"); F**k.Focus(); }
private void Yes_Click(object sender, RoutedEventArgs e) { config.MaxDisplayWidth = Config.DoubleParse(MaxDisplayWidthSet.Text); config.LineHeight = Config.DoubleParse(LineHeightSet.Text); config.ParaGap = Config.DoubleParse(ParaGapSet.Text); double num = Math.Max((ReadingArea.ActualWidth - config.MaxDisplayWidth) / 2.0, 5.0); F**k.Document.PagePadding = new Thickness(num, 0.0, num, 0.0); config.Interval = Config.IntParse(Gap.Text); config.WaitAfter = Config.IntParse(After.Text); config.WaitBefore = Config.IntParse(Before.Text); if (CutOff.IsChecked != config.LongDivide || DivideChapter.IsChecked != config.ChapterDivide || config.Rg != Principle.Text || LimitNumber.Text != config.DivideLimit.ToString()) { config.LongDivide = (CutOff.IsChecked ?? true); config.ChapterDivide = (DivideChapter.IsChecked ?? true); config.Rg = Principle.Text; config.DivideLimit = Config.IntParse(LimitNumber.Text); OpenText(bookReading.filePath); } SettingGrid.Visibility = Visibility.Collapsed; F**k.Focus(); }
private void Cancel_Click(object sender, RoutedEventArgs e) { SettingGrid.Visibility = Visibility.Collapsed; F**k.Focus(); }
private void SwitchAuto() { timer.Enabled = !timer.Enabled; AutoBtn.Content = getAutoReadButtonName(); F**k.Focus(); }