public void View(string path, ContextObject context) { _pdfControl = new PdfViewerControl(); context.ViewerContent = _pdfControl; context.ShowOverlayInfo(""); Exception exception = null; _pdfControl.Dispatcher.BeginInvoke(new Action(() => { try { _pdfControl.LoadPdf(path); context.Title = $"{Path.GetFileName(path)} (1 / {_pdfControl.TotalPages})"; _pdfControl.CurrentPageChanged += UpdateVindowCaption; context.IsBusy = false; } catch (Exception e) { exception = e; } }), DispatcherPriority.Loaded).Wait(); if (exception != null) { ExceptionDispatchInfo.Capture(exception).Throw(); } }
public void View(string path, ContextObject context) { _panel = new WebpagePanel(); context.ViewerContent = _panel; context.Title = Path.GetFileName(path); context.ShowOverlayInfo(""); _panel.Navigate(ExtractMailBody(path)); _panel.Dispatcher.Invoke(() => { context.IsBusy = false; }, DispatcherPriority.Loaded); }
public void View(string path, ContextObject context) { _panel = new WebpagePanel(); context.ViewerContent = _panel; context.Title = Path.GetFileName(path); context.ShowOverlayInfo(""); _panel.LoadHtml(GenerateMarkdownHtml(path)); _panel.Dispatcher.Invoke(() => { context.IsBusy = false; }, DispatcherPriority.Loaded); }
public void View(string path, ContextObject context) { _tvp = new TextViewerPanel(path, context); context.ViewerContent = _tvp; context.Title = $"{Path.GetFileName(path)}"; context.ShowOverlayInfo(""); context.IsBusy = false; }
public void View(string path, ContextObject context) { _panel = new ArchiveInfoPanel(path); context.ViewerContent = _panel; context.Title = $"{Path.GetFileName(path)}"; context.ShowOverlayInfo(""); context.IsBusy = false; }
public void View(string path, ContextObject context) { _panel = new PreviewPanel(); context.ViewerContent = _panel; context.Title = Path.GetFileName(path); context.ShowOverlayInfo(""); _panel.PreviewFile(path, context); context.IsBusy = false; }
public void View(string path, ContextObject context) { _vp = new ViewerPanel(context, probe.HasVideo()); context.ViewerContent = _vp; context.ShowOverlayInfo(probe.RawResult); _vp.mediaElement.MediaOpened += MediaElement_MediaOpened; _vp.LoadAndPlay(path); context.Title = $"{Path.GetFileName(path)}"; }
public void View(string path, ContextObject context) { _ip = new ImagePanel(_meta); var summary = _ip.Meta.GetSummary(); string s = ""; foreach (var item in summary) { s += String.Format("{0,-30}: ", item.Key.ToString()); s += String.Format("{0,-200}", item.Value.ToString()); s += "\n"; } context.ShowOverlayInfo(s); context.ViewerContent = _ip; context.Title = _imageSize.IsEmpty ? $"{Path.GetFileName(path)}" : $"{Path.GetFileName(path)} ({_imageSize.Width}×{_imageSize.Height})"; LoadImage(_ip, path); context.IsBusy = false; }