public void HighLightLine(string Path, int Line) { if (!sourceFiles.ContainsKey(Path)) { return; } var editor = sourceFiles[Path]; IBackgroundRenderer before = null; try { if (editor.TextArea.TextView != null && editor.TextArea.TextView.BackgroundRenderers != null) { before = editor.TextArea.TextView.BackgroundRenderers.First(r => r.GetType().ToString().Contains("HighlightCurrentLineBackgroundRenderer")); } } catch { } if (before != null) { editor.TextArea.TextView.BackgroundRenderers.Remove(before); } var line = editor.Document.GetLineByNumber(Line); var backgroundRenderer = new HighlightCurrentLineBackgroundRenderer(editor, line, Brushes.LightGray); editor.TextArea.TextView.BackgroundRenderers.Add(backgroundRenderer); editor.InvalidateVisual(); editor.ScrollToLine(Line); }
private void InitializeRenderers() { _bookmarkRenderer = new BookmarkRenderer(this); _errorRenderer = new ErrorRenderer(this); TextArea.TextView.BackgroundRenderers.Add(_bookmarkRenderer); TextArea.TextView.BackgroundRenderers.Add(_errorRenderer); }
private void InitializeRenderers() { _sectionRenderer = new SectionRenderer(this); if (ShowSectionSeparators) { TextArea.TextView.BackgroundRenderers.Add(_sectionRenderer); } }
public Label() { this.IsVisible = true; this.mBackgroundRenderer = new EmptyBackgroundRenderer(); }
public override void LoadContent(ContentManager contentManager) { base.LoadContent(contentManager); this.mFontMenuButton = contentManager.Load<SpriteFont>("Fonts/DefaultSmall"); this.mBlankTexture = contentManager.Load<Texture2D>("Sprites/Blank"); this.mBackgroundRenderer = new SolidBackgroundRenderer(this.mBlankTexture, Color.Gold); }