Exemplo n.º 1
0
        public override void FillRenderStateItem(ITextEditor textEditor, RenderStateItem rsi)
        {
            if (this._win32ColorsLoaded == false)
            {
                this._win32ColorsLoaded = true;

                var cF = this.GetColorFore(textEditor); // Bridge.Get().Get("Text.Style." + NameKey + ".Text.Color.Fore", this.ColorFore);
                var cB = this.GetColorBack(textEditor); // Bridge.Get().Get("Text.Style." + NameKey + ".Text.Color.Back", this.ColorBack);

                if (cF.A != 0 && cF != Color.Empty)
                {
                    this._win32ForeColor = ColorTranslator.ToWin32(cF);
                }

                if (cB.A != 0 && cB != Color.Empty)
                {
                    this._win32BackColor = ColorTranslator.ToWin32(cB);
                }
            }

            if (this._win32BackColor != -1)
            {
                rsi.BackColor = this._win32BackColor;
            }

            if (this._win32ForeColor != -1)
            {
                rsi.ForeColor = this._win32ForeColor;
            }
        }
Exemplo n.º 2
0
        public override RenderStateItem GetNaturalRenderColors(ITextEditor textEditor)
        {
            var rsi = new RenderStateItem();

            this.FillRenderStateItem(textEditor, rsi);
            return(rsi);
        }
Exemplo n.º 3
0
        public RenderState(ITextEditor textEditor, TextStyleBase defaultStyle)
        {
            var rsi = new RenderStateItem();

            defaultStyle.FillRenderStateItem(textEditor, rsi);

            this._defaultRenderStateItem = rsi;
        }
Exemplo n.º 4
0
        public override RenderStateItem GetNaturalRenderColors(ITextEditor textEditor)
        {
            var rsi = new RenderStateItem();

            this.FillRenderStateItem(textEditor, rsi);

            rsi.BackColor = ColorTranslator.ToWin32(Color.Red);

            return(rsi);
        }
Exemplo n.º 5
0
        public override RenderStateItem GetNaturalRenderColors(ITextEditor textEditor)
        {
            var rsi = new RenderStateItem();

            this.FillRenderStateItem(textEditor, rsi);

            rsi.ForeColor = ColorTranslator.ToWin32(staticUnderlineColor);

            return(rsi);
        }
Exemplo n.º 6
0
        public bool Add(ITextEditor textEditor, ITextSegmentStyled segment)
        {
            var newRsi = new RenderStateItem {
                Segment = segment
            };

            segment.Style.FillRenderStateItem(textEditor, newRsi);

            this._items.Add(newRsi);

            return(true);
        }
Exemplo n.º 7
0
        public override void FillRenderStateItem(ITextEditor textEditor, RenderStateItem rsi)
        {
            if (this._win32ColorFore == -1)
            {
                this._win32ColorFore = ColorTranslator.ToWin32(this.ColorFont);
                this._win32ColorBack = ColorTranslator.ToWin32(this.ColorBackground);
            }

            if (this._win32ColorBack != -1)
            {
                rsi.BackColor = this._win32ColorBack;
            }

            if (this._win32ColorFore != -1)
            {
                rsi.ForeColor = this._win32ColorFore;
            }

            rsi.BackColorZIndex = rsi.ForeColorZIndex = this.RenderZIndex;
        }
Exemplo n.º 8
0
 public override void FillRenderStateItem(ITextEditor textEditor, RenderStateItem rsi)
 {
 }
Exemplo n.º 9
0
 /// <summary>
 /// Fills the specified <see cref="RenderStateItem"/> with the colors used by this text style.
 /// </summary>
 /// <param name="textEditor"></param>
 /// <param name="rsi"></param>
 public abstract void FillRenderStateItem(ITextEditor textEditor, RenderStateItem rsi);