예제 #1
0
        public void ApplySyntaxHighlight()
        {
            color             = new Coloring();
            syntaxHighlighted = true;
            string[] types      = new string[] { "int ", "integer ", "float ", "single ", "double ", "decimal ", "bool ", "boolean ", "string " };
            string[] operators  = new string[] { "!", "=", ">", "<", "|", "@", "%", "+", "-", "*", "/", "\\", "?", ";", ":" };
            string[] statements = new string[] { "if", "else if", "elif", "elseif", "endif", "if else", "else", "true", "false", "try", "catch", "finally", "public", "private", "protected", "static", "using", "import", "include", "define", "void", "while", "for", "return", "continue", "break" };
            string[] misc       = new string[] { "#", "$", "\"", "'", "region", "endregion" };
            string[] numbers    = new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };

            color.FindAndColorArray(types, Color.Blue, main.wandTextBox);
            color.FindAndColorArray(operators, Color.Red, main.wandTextBox);
            color.FindAndColorArray(statements, Color.Purple, main.wandTextBox);
            color.FindAndColorArray(misc, Color.Khaki, main.wandTextBox);
            color.FindAndColorArray(numbers, Color.DarkViolet, main.wandTextBox);
        }
예제 #2
0
        private void PrintHistory()
        {
            int    counter = cmdHistory.Length - 1;
            string text    = string.Empty;

            if (coloring == null)
            {
                coloring = new Coloring();
            }
            for (int i = 0; i < cmdHistory.Length; ++i)
            {
                text = counter.ToString() + ") " + cmdHistory[i];
                AddTextToConsole(text);
                coloring.FindAndColorString(text, Color.DarkOrange, outputBox);
                --counter;
            }
            //AddTextToConsole("\n");
        }