Exemplo n.º 1
0
 private bool OpenXpsFromFile(FileInfo fileInfo)
 {
     try {
         DisplayXps(XpsReader.Create(fileInfo));
         return(true);
     }
     catch (Exception ex) {
         SetStatus("Open failed: " + ex.Message, true);
         return(false);
     }
 }
Exemplo n.º 2
0
        private void DisplayXps(XpsReader reader)
        {
            if (this.reader != null)
            {
                this.reader.Close();
            }

            this.reader          = reader;
            this.pageNr          = 1;
            this.firstPageLoaded = false;
            this.page.Opacity    = 0;

            DisplayPage();
        }
Exemplo n.º 3
0
 private void webClient_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         try {
             DisplayXps(XpsReader.Create(new StreamResourceInfo(e.Result, null)));
         }
         catch (Exception ex) {
             SetStatus("Xps read failed: " + ex.Message, true);
         }
     }
     else
     {
         SetStatus(string.Format("Download failed: {0}", e.Error.Message), true);
     }
 }