private bool OpenXpsFromFile(FileInfo fileInfo) { try { DisplayXps(XpsReader.Create(fileInfo)); return(true); } catch (Exception ex) { SetStatus("Open failed: " + ex.Message, true); return(false); } }
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(); }
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); } }