mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-11 17:59:17 +00:00
26 lines
639 B
C#
26 lines
639 B
C#
using System.IO;
|
|
using System.Windows.Controls;
|
|
using ICSharpCode.AvalonEdit.Highlighting;
|
|
|
|
namespace QuickLook.Plugin.TextViewer
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for TextViewerPanel.xaml
|
|
/// </summary>
|
|
public partial class TextViewerPanel : UserControl
|
|
{
|
|
public TextViewerPanel(string path)
|
|
{
|
|
InitializeComponent();
|
|
|
|
LoadFile(path);
|
|
}
|
|
|
|
private void LoadFile(string path)
|
|
{
|
|
viewer.Load(path);
|
|
|
|
viewer.SyntaxHighlighting = HighlightingManager.Instance.GetDefinitionByExtension(Path.GetExtension(path));
|
|
}
|
|
}
|
|
} |