You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
944 B
33 lines
944 B
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) |
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) |
|
|
|
using System; |
|
using System.IO; |
|
using ICSharpCode.AvalonEdit; |
|
using ICSharpCode.AvalonEdit.Highlighting; |
|
using ICSharpCode.Core; |
|
using ICSharpCode.SharpDevelop.Editor.AvalonEdit; |
|
|
|
namespace ICSharpCode.SharpSnippetCompiler.Core |
|
{ |
|
public class SharpSnippetTextEditorAdapter : AvalonEditTextEditorAdapter |
|
{ |
|
FileName fileName; |
|
|
|
public SharpSnippetTextEditorAdapter(TextEditor textEditor) |
|
: base(textEditor) |
|
{ |
|
} |
|
|
|
public override FileName FileName { |
|
get { return this.fileName; } |
|
} |
|
|
|
public void LoadFile(string fileName) |
|
{ |
|
TextEditor.SyntaxHighlighting = HighlightingManager.Instance.GetDefinitionByExtension(Path.GetExtension(fileName)); |
|
TextEditor.Load(fileName); |
|
this.fileName = new FileName(fileName); |
|
} |
|
} |
|
}
|
|
|