Пример #1
0
        public static void loadDict()
        {
            colorCodings = new List <ColorCoding>();

            colorCodings.Add(ColorCoding.Get(CommandParser.cmds, Color.FromArgb(0, 185, 255)));
            colorCodings.Add(ColorCoding.Get(CommandParser.grp2, Color.MediumAquamarine));
            colorCodings.Add(ColorCoding.Get(CommandParser.names, Color.OrangeRed));
            colorCodings.Add(ColorCoding.Get(CommandParser.scoreboards, Color.OrangeRed));
            colorCodings.Add(ColorCoding.Get(CommandParser.effects, Color.OrangeRed));
            colorCodings.Add(ColorCoding.Get(CommandParser.gamerules.ToArray(), Color.OrangeRed));
            colorCodings.Add(ColorCoding.Get(CommandParser.sounds, Color.OrangeRed));

            colorCodings.Add(ColorCoding.GetPackage(package.ToArray(), Color.LightSteelBlue));

            colorCodings.Add(ColorCoding.GetSelector(selector, Color.LightBlue));
            colorCodings.Add(new ColorCoding(Color.Magenta, numberRegex));
            colorCodings.Add(new ColorCoding(Color.Gray, commentRegex));
            colorCodings.Add(new ColorCoding(Color.FromArgb(0, 128, 14), wordRegex));
        }
Пример #2
0
        public static void loadDict()
        {
            Color cClass    = Color.FromArgb(68, 201, 162);
            Color cFunction = Color.FromArgb(124, 220, 240);
            Color cString   = Color.FromArgb(218, 105, 26);
            Color cKeyword  = Color.FromArgb(255, 255, 200);

            colorCodings = new List <ColorCoding>();
            colorCodings.Add(ColorCoding.GetSelector(selector, Color.LightBlue, ""));
            colorCodings.Add(ColorCoding.Get(blueWord, Color.Aqua, "Bold"));

            colorCodings.Add(ColorCoding.Get(CommandParser.funcName, Color.FromArgb(0, 185, 255), ""));
            colorCodings.Add(ColorCoding.Get(defWord.Concat(importWord).Concat(defWordMore1).Concat(defWordMore1F).Concat(defWordMore1M).Concat(defWordMore1L).Distinct().ToArray(),
                                             Color.FromArgb(74, 156, 199), "Bold"));

            colorCodings.Add(ColorCoding.Get(funKeyword
                                             .Concat(compKeyword)
                                             .Concat(tags.ToArray()).Distinct()
                                             .Concat(CommandParser.dataattribute.Select(x => "\\[" + x + "\\]"))
                                             .Distinct()
                                             .ToArray(), Color.Magenta, "Bold"));

            colorCodings.Add(ColorCoding.Get(typKeyword.Distinct().ToArray(), Color.Orange, "Bold"));

            if (showName)
            {
                colorCodings.Add(ColorCoding.Get(CommandParser.names
                                                 .Concat(CommandParser.scoreboards)
                                                 .Concat(CommandParser.effects)
                                                 .Concat(CommandParser.gamerules)
                                                 .Concat(CommandParser.sounds)
                                                 .Concat(CommandParser.particles)
                                                 .Distinct()
                                                 .ToArray(), cKeyword, ""));
            }


            colorCodings.Add(new ColorCoding(Color.Magenta, numberRegex, @"(-?\b)(\d+\.\d+|\d+)[bldsf]?\b", ""));
            colorCodings.Add(ColorCoding.Get(structs.Concat(enums).Distinct().ToArray(), cClass, "Bold"));
            colorCodings.Add(ColorCoding.Get(defWordMore2.Distinct().ToArray(), cFunction, ""));
            colorCodings.Add(ColorCoding.GetPackage(package.Distinct().ToArray(), Color.FromArgb(74, 156, 199), ""));

            if (showEnumValue)
            {
                colorCodings.Add(ColorCoding.Get(enumsValue.Distinct().ToArray(), Color.LightGreen, ""));
            }

            colorCodings.Add(new ColorCoding(Color.Gray, commentRegex, @"(?s)(//[^\n]*|/\*[^*]*\*/)", "Italic"));
            colorCodings.Add(new ColorCoding(cString, wordRegex, "\"[^\"]*\"", "Italic"));
            colorCodings.Add(new ColorCoding(Color.LightYellow, funcDocRegex, "(?s)\"\"\"[^\"\"\"]*\"\"\"", "Italic"));
            generateXML();

            string path = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "/assets/";

            IMG_Class         = Image.FromFile(path + "class.png");
            IMG_Enum          = Image.FromFile(path + "enum.png");
            IMG_Method        = Image.FromFile(path + "method.png");
            IMG_Lazy_Method   = Image.FromFile(path + "lazy_method.png");
            IMG_Event         = Image.FromFile(path + "event.png");
            IMG_Word          = Image.FromFile(path + "word.png");
            IMG_String        = Image.FromFile(path + "string.png");
            IMG_Package       = Image.FromFile(path + "package.png");
            IMG_Entity        = Image.FromFile(path + "entity.png");
            IMG_Sound         = Image.FromFile(path + "sound.png");
            IMG_Variable      = Image.FromFile(path + "variable.png");
            IMG_Object_Method = Image.FromFile(path + "object_method.png");
            IMG_Particles     = Image.FromFile(path + "particles.png");
        }