Esempio n. 1
0
        private static void SetLogFileHighlighting()
        {
            string[] goodLevels = new string[] { "DEBUG", "INFO" };
            string[] warnLevels = new string[] { "WARN" };
            string[] badLevels  = new string[] { "ERROR", "FATAL" };

            UrielGuy.SyntaxHighlighting.HighLightDescriptorCollection coll = new UrielGuy.SyntaxHighlighting.HighLightDescriptorCollection();
            for (int i = 0; i < goodLevels.Length; i++)
            {
                coll.Add(new HighlightDescriptor(goodLevels[i], Color.LawnGreen, null, DescriptorType.Word, DescriptorRecognition.WholeWord, true));
            }

            for (int i = 0; i < warnLevels.Length; i++)
            {
                coll.Add(new HighlightDescriptor(warnLevels[i], Color.Orange, null, DescriptorType.Word, DescriptorRecognition.WholeWord, true));
            }

            for (int i = 0; i < badLevels.Length; i++)
            {
                coll.Add(new HighlightDescriptor(badLevels[i], Color.Red, null, DescriptorType.Word, DescriptorRecognition.WholeWord, true));
            }


            coll.Add(new HighlightDescriptor(@"\[Thread:", "]", Color.Gray, null, DescriptorType.ToCloseToken, DescriptorRecognition.RegularExpression, false));
            coll.Add(new HighlightDescriptor(@"\d\d\d\d-\d\d-\d\d", Color.Gray, null, DescriptorType.Word, DescriptorRecognition.RegularExpression, false));
            coll.Add(new HighlightDescriptor(@"\d\d:\d\d:\d\d,\d\d\d", Color.Gray, null, DescriptorType.Word, DescriptorRecognition.RegularExpression, false));
            coll.Add(new HighlightDescriptor(@"(\(\w*\.\w*\))|(\(\w*\.\w*\.\w*\))|(\(\w*\.\w*\.\w*\.\w*\))|(\(\w*\.\w*\.\w*\.\w*\.\w*\))", Color.Gray, null, DescriptorType.Word, DescriptorRecognition.RegularExpression, false));

            logFileHighlighting = coll;
        }
Esempio n. 2
0
        private static void SetSqlHighlighting(string[] keywords, string[] functions)
        {
            UrielGuy.SyntaxHighlighting.HighLightDescriptorCollection coll = new UrielGuy.SyntaxHighlighting.HighLightDescriptorCollection();
            for (int i = 0; i < keywords.Length; i++)
            {
                coll.Add(new HighlightDescriptor(keywords[i], Color.Blue, null, DescriptorType.Word, DescriptorRecognition.WholeWord, true));
            }
            for (int i = 0; i < functions.Length; i++)
            {
                coll.Add(new HighlightDescriptor(functions[i], Color.Magenta, null, DescriptorType.Word, DescriptorRecognition.WholeWord, true));
            }
            coll.Add(new HighlightDescriptor("GO", Color.Purple, null, DescriptorType.Word, DescriptorRecognition.WholeWord, true));
            coll.Add(new HighlightDescriptor("/*", "*/", Color.Green, null, DescriptorType.ToCloseToken, DescriptorRecognition.StartsWith, false));
            //coll.Add(new HighlightDescriptor("'", "'", Color.Red, null, DescriptorType.ToCloseToken, DescriptorRecognition.StartsWith, false));
            coll.Add(new HighlightDescriptor("--", Color.Green, null, DescriptorType.ToEOL, DescriptorRecognition.StartsWith, false));

            sqlHighlighting = coll;
        }