public override void Attach(ITextEditor editor) { base.Attach(editor); // try to access the ICSharpCode.AvalonEdit.Rendering.TextView // of this ITextEditor this.textView = editor.GetService(typeof(TextView)) as TextView; // if editor is not an AvalonEdit.TextEditor // GetService returns null if (textView != null) { if (SD.Workbench != null) { // if (XamlBindingOptions.UseAdvancedHighlighting) { // colorizer = new XamlColorizer(editor, textView); // // attach the colorizer // textView.LineTransformers.Add(colorizer); // } // add the XamlOutlineContentHost, which manages the tree view contentHost = new XamlOutlineContentHost(editor); textView.Services.AddService(typeof(IOutlineContentHost), contentHost); } // add ILanguageBinding textView.Services.AddService(typeof(XamlTextEditorExtension), this); } SD.ParserService.ParseInformationUpdated += ParseInformationUpdated; }
public override void Attach(ITextEditor editor) { base.Attach(editor); // try to access the ICSharpCode.AvalonEdit.Rendering.TextView // of this ITextEditor this.textView = editor.GetService(typeof(TextView)) as TextView; // if editor is not an AvalonEdit.TextEditor // GetService returns null if (textView != null) { if (SD.Workbench != null) { // if (XamlBindingOptions.UseAdvancedHighlighting) { // colorizer = new XamlColorizer(editor, textView); // // attach the colorizer // textView.LineTransformers.Add(colorizer); // } // add the XamlOutlineContentHost, which manages the tree view contentHost = new XamlOutlineContentHost(editor); textView.Services.AddService(typeof(IOutlineContentHost), contentHost); } // add ILanguageBinding textView.Services.AddService(typeof(XamlTextEditorExtension), this); } SD.ParserService.ParseInformationUpdated += ParseInformationUpdated; }