public void View(string path, ContextObject context) { _tvp = new TextViewerPanel(path); context.ViewerContent = _tvp; context.Title = $"{Path.GetFileName(path)}"; context.IsBusy = false; }
public void View(string path, ContextObject context) { if (path.ToLower().EndsWith(".rtf")) { var rtfBox = new RichTextBox(); FileStream fs = File.OpenRead(path); rtfBox.Selection.Load(fs, DataFormats.Rtf); rtfBox.IsReadOnly = true; rtfBox.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; rtfBox.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; context.ViewerContent = rtfBox; context.IsBusy = false; } else { _tvp = new TextViewerPanel(path, context); context.ViewerContent = _tvp; } context.Title = $"{Path.GetFileName(path)}"; }
public void Cleanup() { _tvp = null; }
public void Cleanup() { _tvp?.Dispose(); _tvp = null; }
private void AssignHighlightingManager(TextViewerPanel tvp, ContextObject context) { var isDark = (context.Theme == Themes.Dark) | OSThemeHelper.AppsUseDarkTheme() | false; tvp.HighlightingManager = isDark ? _hlmDark : _hlmLight; }