Ejemplo 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);
     }
 }
Ejemplo n.º 2
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);
     }
 }