public void Attach(ITextEditor editor) { // ITextEditor is SharpDevelop's abstraction of the text editor. // We use GetService() to get the underlying AvalonEdit instance. textView = editor.GetService(typeof(TextView)) as TextView; if (textView != null) { g = new ImageElementGenerator(Path.GetDirectoryName(editor.FileName)); textView.ElementGenerators.Add(g); } }
public void Attach(ITextEditor editor) { // ITextEditor is SharpDevelop's abstraction of the text editor. // We use GetService() to get the underlying AvalonEdit instance. textView = editor.GetService(typeof(TextView)) as TextView; if (textView != null) { g = new ImageElementGenerator(Path.GetDirectoryName(editor.FileName)); textView.ElementGenerators.Add(g); } }