Esempio n. 1
0
        void ApplySyntaxColoring(Types.ColorableElement Element)
        {
            System.Drawing.Brush     foreBrush = new System.Drawing.SolidBrush(GR.Color.Helper.FromARGB(Core.Settings.FGColor(Element)));
            System.Drawing.Brush     backBrush = null;
            System.Drawing.FontStyle fontStyle = System.Drawing.FontStyle.Regular;

            backBrush = new System.Drawing.SolidBrush(GR.Color.Helper.FromARGB(Core.Settings.BGColor(Element)));
            m_TextStyles[SyntaxElementStylePrio(Element)] = new FastColoredTextBoxNS.TextStyle(foreBrush, backBrush, fontStyle);

            //editSource.AddStyle( m_TextStyles[(int)Element] );
            editText.Styles[SyntaxElementStylePrio(Element)] = m_TextStyles[SyntaxElementStylePrio(Element)];
        }
        int SyntaxElementStylePrio(Types.ColorableElement Element)
        {
            int value = 10;

            switch (Element)
            {
            case RetroDevStudio.Types.ColorableElement.CODE:
                value = 6;
                break;

            case RetroDevStudio.Types.ColorableElement.COMMENT:
                value = 2;
                break;

            case RetroDevStudio.Types.ColorableElement.CURRENT_DEBUG_LINE:
                value = 1;
                break;

            case RetroDevStudio.Types.ColorableElement.EMPTY_SPACE:
                value = 0;
                break;

            case RetroDevStudio.Types.ColorableElement.LABEL:
                value = 7;
                break;

            case RetroDevStudio.Types.ColorableElement.LITERAL_NUMBER:
                value = 3;
                break;

            case RetroDevStudio.Types.ColorableElement.LITERAL_STRING:
                value = 4;
                break;

            case RetroDevStudio.Types.ColorableElement.PSEUDO_OP:
                value = 5;
                break;

            case RetroDevStudio.Types.ColorableElement.NONE:
                value = 9;
                break;

            case RetroDevStudio.Types.ColorableElement.OPERATOR:
                value = 8;
                break;
            }
            return(value);
        }
Esempio n. 3
0
        void ApplySyntaxColoring(Types.ColorableElement Element)
        {
            System.Drawing.Brush     foreBrush = new System.Drawing.SolidBrush(GR.Color.Helper.FromARGB(Core.Settings.SyntaxColoring[Element].FGColor));
            System.Drawing.Brush     backBrush = null;
            System.Drawing.FontStyle fontStyle = System.Drawing.FontStyle.Regular;

            if (Core.Settings.SyntaxColoring[Element].BGColorAuto)
            {
                backBrush = new System.Drawing.SolidBrush(GR.Color.Helper.FromARGB(Core.Settings.SyntaxColoring[Types.ColorableElement.EMPTY_SPACE].BGColor));
            }
            else
            {
                backBrush = new System.Drawing.SolidBrush(GR.Color.Helper.FromARGB(Core.Settings.SyntaxColoring[Element].BGColor));
            }

            m_TextStyles[SyntaxElementStylePrio(Element)] = new FastColoredTextBoxNS.TextStyle(foreBrush, backBrush, fontStyle);

            //editSource.AddStyle( m_TextStyles[(int)Element] );
            editDisassembly.Styles[SyntaxElementStylePrio(Element)] = m_TextStyles[SyntaxElementStylePrio(Element)];
        }
Esempio n. 4
0
 public TokenSyntax(string Token, Types.ColorableElement Type)
 {
     this.Token = Token;
     this.Type  = Type;
 }