Ejemplo n.º 1
0
        //Чтение выбранной книги
        private void _Book_Click(object sender, RoutedEventArgs e)
        {
            int  index      = Books.IndexOf((Book)(sender as Button).Tag);
            Book chosenBook = Books[index];

            switch (chosenBook.GetSourceType())
            {
            case Book.ResourceType.Local:
                ReaderGrid.Visibility = Visibility.Visible;
                PDFReader.LoadFile(chosenBook.GetSource());
                PDFReader.Show();
                PDFReader.Focus();
                break;

            case Book.ResourceType.Internet:
                try {
                    PDFBrowser.Navigate(chosenBook.GetSource());
                    WebReaderGrid.Visibility = Visibility.Visible;
                }
                catch (UriFormatException ex) {
                    MessageBox.Show(ex.Message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }
                break;
            }
            _Back_.Visibility = Visibility.Visible;
        }
Ejemplo n.º 2
0
 //Режим чтения
 private void _ReadingMode__Click(object sender, RoutedEventArgs e)
 {
     PDFReader.Focus();
     if (!IsReadingModeActive)
     {
         WindowStyle = WindowStyle.None;
         if (settings.IsFullscreen)
         {
             WindowState = WindowState.Normal;
         }
         WindowState         = WindowState.Maximized;
         IsReadingModeActive = true;
     }
     else
     {
         WindowStyle = WindowStyle.SingleBorderWindow;
         WindowState = WindowState.Normal;
         if (settings.IsFullscreen)
         {
             WindowState = WindowState.Maximized;
         }
         IsReadingModeActive = false;
     }
 }