예제 #1
0
        protected virtual void WriteLine(string Line, int Style, int Start, int End)
        {
            FontStyle  style2;
            Color      color1;
            Color      color2;
            ColorFlags flags1 = ColorFlags.None;
            SyntaxEdit edit1  = this.owner as SyntaxEdit;
            ILexStyle  style1 = edit1.GetLexStyle(Style, ref flags1);

            if (style1 != null)
            {
                style2 = edit1.GetFontStyle(style1.FontStyle, flags1);
                color1 = edit1.GetFontColor(style1.ForeColor, flags1);
                if (style1.BackColor != Color.Empty)
                {
                    color2 = style1.BackColor;
                }
                else
                {
                    color2 = this.owner.BackColor;
                }
            }
            else
            {
                style2 = edit1.GetFontStyle(this.owner.Font.Style, flags1);
                color1 = edit1.GetFontColor(this.owner.ForeColor, flags1);
                color2 = this.owner.BackColor;
            }
            this.ApplyStyle(style2, color1, color2);
            this.WriteText(Start, Line.Substring(Start, (End - Start) + 1));
        }
예제 #2
0
 public void Assign(ILexStyle Source)
 {
     this.name      = Source.Name;
     this.desc      = Source.Desc;
     this.foreColor = Source.ForeColor;
     this.backColor = Source.BackColor;
     this.fontStyle = Source.FontStyle;
     this.plainText = Source.PlainText;
 }
예제 #3
0
        private void AddStyle(string Name, Color Color, bool PlainText)
        {
            ILexStyle style1 = base.Scheme.AddLexStyle();

            style1.Name = Name;
            if (Color != Color.Empty)
            {
                style1.ForeColor = Color;
            }
            style1.PlainText = PlainText;
        }
예제 #4
0
 private void CopyStyles(ILexStyle[] FromStyles, ILexStyle[] ToStyles)
 {
     if ((FromStyles != null) && (ToStyles != null))
     {
         ILexStyle[] styleArray1 = FromStyles;
         for (int num2 = 0; num2 < styleArray1.Length; num2++)
         {
             ILexStyle style2 = styleArray1[num2];
             int       num1   = this.GetStyleByName(ToStyles, style2.Name);
             if (num1 >= 0)
             {
                 ILexStyle style1 = ToStyles[num1];
                 style1.ForeColor = style2.ForeColor;
                 style1.BackColor = style2.BackColor;
                 style1.FontStyle = style2.FontStyle;
             }
         }
     }
 }
예제 #5
0
파일: Lexer.cs 프로젝트: stevencohn/Orqa
        private void StateFromMatch(Match match, string s, Hashtable blocks, ref int state, ref int style)
        {
            style = -1;
            LexSyntaxBlock block1 = null;

            for (int num1 = 0; num1 < match.Groups.Count; num1++)
            {
                if (match.Groups[num1].Success)
                {
                    block1 = (LexSyntaxBlock)blocks[num1];
                    if (block1 != null)
                    {
                        break;
                    }
                }
            }
            if (block1 != null)
            {
                if (block1.LeaveState != null)
                {
                    state = block1.LeaveState.Index;
                }
                if (block1.Style != null)
                {
                    style = block1.Style.Index;
                }
                int num2 = block1.FindResWord(s);
                if (num2 >= 0)
                {
                    ILexStyle style1 = block1.ResWordSets[num2].ResWordStyle;
                    if (style1 != null)
                    {
                        style = style1.Index;
                    }
                }
            }
        }