Exemple #1
0
        /// <summary>
        /// Create a new instance of the document viewer, open the xps document, and navigate to the
        /// designated page.
        /// </summary>
        private void ShowHelp()
        {
            xpsDocumentViewer = new XPSDocumentViewer();

            System.Windows.Xps.Packaging.XpsDocument xpsDoc = new System.Windows.Xps.Packaging.XpsDocument(_env.strAppDir + "\\Help\\" + _strXPSFile, System.IO.FileAccess.Read);
            xpsDocumentViewer.xpsViewer1.Document = xpsDoc.GetFixedDocumentSequence();
            xpsDocumentViewer.ReferenceHelp       = this;



            m_intCurrentPageNumber = PageNumber;
            System.Windows.Documents.DocumentPage oPage = xpsDocumentViewer.xpsViewer1.Document.DocumentPaginator.GetPage(PageNumber);

            xpsDocumentViewer.xpsViewer1.GoToPage(PageNumber);

            xpsDocumentViewer.WindowState           = WindowState.Normal;
            xpsDocumentViewer.Top                   = frmMain.g_oFrmMain.Top;
            xpsDocumentViewer.Height                = frmMain.g_oFrmMain.ClientSize.Height;
            xpsDocumentViewer.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            xpsDocumentViewer.IsEnabled             = true;
            xpsDocumentViewer.Visibility            = Visibility.Visible;

            m_oXpsDocument = xpsDoc;



            xpsDocumentViewer.ShowDialog();
        }
Exemple #2
0
        /// <summary>
        /// Close the document viewer and thread
        /// </summary>
        private void ShutdownThread()
        {
            if (xpsDocumentViewer != null)
            {
                xpsDocumentViewer.Dispatcher.Invoke(DispatcherPriority.Normal, (Action) delegate()
                {
                    xpsDocumentViewer.Close();
                });

                xpsDocumentViewer = null;
            }
            if (m_oHelpThread.IsAlive)
            {
                m_oHelpThread.Abort();
            }
        }