Ejemplo n.º 1
0
        public Span _getSyntaxSpan(string word, SyntaxHighlighter.SyntaxType style)
        {
            #region ApplySpanStyle
            Span s = new Span(new Run(word));
            switch (style)
            {
            case SyntaxHighlighter.SyntaxType.Operation:
                s.Foreground = new SolidColorBrush(Colors.Blue);
                s.FontWeight = FontWeights.Bold;
                break;

            case SyntaxHighlighter.SyntaxType.Comment:
                s.Foreground = new SolidColorBrush(Colors.DarkGray);
                break;

            case SyntaxHighlighter.SyntaxType.Number:
                s.Foreground = new SolidColorBrush(Colors.Orange);
                break;

            case SyntaxHighlighter.SyntaxType.Register:
                s.Foreground = new SolidColorBrush(Colors.Green);
                s.FontWeight = FontWeights.Bold;
                break;

            case SyntaxHighlighter.SyntaxType.PlainText:
                // Do Nothing

                break;
            }
            return(s);

            #endregion
        }
Ejemplo n.º 2
0
 public SyntaxTag(TextPointer s, TextPointer e, SyntaxHighlighter.SyntaxType t)
 {
     start = s; end = e; type = t;
 }