コード例 #1
0
ファイル: SourceWindow.cs プロジェクト: lomomike/netext
        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);
        }
コード例 #2
0
        private void InitializeRenderers()
        {
            _bookmarkRenderer = new BookmarkRenderer(this);
            _errorRenderer    = new ErrorRenderer(this);

            TextArea.TextView.BackgroundRenderers.Add(_bookmarkRenderer);
            TextArea.TextView.BackgroundRenderers.Add(_errorRenderer);
        }
コード例 #3
0
        private void InitializeRenderers()
        {
            _sectionRenderer = new SectionRenderer(this);

            if (ShowSectionSeparators)
            {
                TextArea.TextView.BackgroundRenderers.Add(_sectionRenderer);
            }
        }
コード例 #4
0
ファイル: Label.cs プロジェクト: cmprog/BusyBeekeeper
 public Label()
 {
     this.IsVisible = true;
     this.mBackgroundRenderer = new EmptyBackgroundRenderer();
 }
コード例 #5
0
        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);
        }