private void HyperlinkViewDocument_Click(object sender, RoutedEventArgs e) { Hyperlink hyperLink = (Hyperlink)sender; YellowstonePathology.YpiConnect.Contract.RemoteFile remoteFile = (YellowstonePathology.YpiConnect.Contract.RemoteFile)hyperLink.Tag; if (remoteFile.IsDownloaded == false) { YellowstonePathology.YpiConnect.Proxy.FileTransferServiceProxy fileTransferServiceProxy = new Proxy.FileTransferServiceProxy(); fileTransferServiceProxy.Download(ref remoteFile, YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.Instance.WebServiceAccount); } if (remoteFile.Extension == ".XPS") { XpsDocument xpsDocument = XpsDocumentHelper.FromMemoryStream(remoteFile.MemoryStream); XpsDocumentViewer xpsDocumentViewer = new XpsDocumentViewer(); xpsDocumentViewer.LoadDocument(xpsDocument); xpsDocumentViewer.ShowDialog(); } if (remoteFile.Extension == ".TIF") { TifDocumentViewer tifDocumentViewer = new TifDocumentViewer(); tifDocumentViewer.Load(remoteFile.MemoryStream); tifDocumentViewer.ShowDialog(); } }
public YellowstonePathology.YpiConnect.Contract.MethodResult Download() { YellowstonePathology.YpiConnect.Contract.RemoteFile remoteFile = new Contract.RemoteFile(this.m_ReportNo, this.m_CaseDocumentType); YellowstonePathology.YpiConnect.Contract.MethodResult methodResult = this.m_FileTransferServiceProxy.Download(ref remoteFile, YellowstonePathology.YpiConnect.Contract.Identity.ApplicationIdentity.Instance.WebServiceAccount); if (methodResult.Success == true) { this.m_XpsDocument = XpsDocumentHelper.FromMemoryStream(remoteFile.MemoryStream); this.m_IsDownloaded = true; } return(methodResult); }