Пример #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;
        }
Пример #2
0
 private void S1_Load(object sender, EventArgs e)
 {
     PDFReader.LoadFile(@"C:\Users\10442\Desktop\925 ppt\A comparative review of IPv4 and IPv6 for research test bed.pdf");
 }