Tool/ControlUtils.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Drawing;
using System.Text.RegularExpressions;
using System.Windows.Forms;

namespace CodeGen.Tool
{
    class ControlUtils
    {
        public static void SetSQLColor(RichTextBox ctrl)
        {
            int pos = ctrl.SelectionStart;
            ctrl.SelectAll();
            ctrl.SelectionColor = Color.Black;
            string[] keywords = { "select", "distinct", "from", "where", 
                                    "order", "by", "group", "null","desc","asc",
                                    "update","delete","insert", "into", "set" };
            SetColor(ctrl, keywords);
            ctrl.SelectionStart = pos;
            ctrl.Select(pos, 0);
        }


        public  static void SetHTMLColor(RichTextBox ctrl)
        {

            ctrl.SelectAll();
            ctrl.SelectionColor = Color.Black;
            int pos = ctrl.SelectionStart;
            /*
            string[] keywords = { "<html", "</html", "<head", "</head", "<title","</title", "<body", "</body", 
                                    "<input", "<select", "</select","<option","<div","</div", "<label","<form", "</form",
                                    "<script", "</script","<style","</style", "<table", "</table", 
                                    "<tr","</tr","<td","</td","<font"};
            SetColor(ctrl, keywords, Color.Blue);*/
            SetHTMLTagColor(ctrl);
            string[] keywords2 = { " action"," class", "class "," rowspan", " colspan", 
                                " align","function ", "return ", "return;", "break;", "continue;"
                                 ,"if\\(", "if ", "else", "try", "catch", "finaly", "switch", "case ",
                                 "for ","for\\(", "foreach", "int ", "string ", "float ",
                                 "decimal ", "DateTime ","long ", "double ", "void ", "while ", "while\\(", " in ",
                                 "private ", "protected ", "public ", "inneral",
                                 "abstract ", "override ", "static ", "const ",
                                 "partial ", "using ", "this.", "base\\.", "namespace ", "where ",
                                 "throw ", " type", " id", " as ", " is ", "typeof", "value",
                                 "package ", "import ", "final ", "\\#include "};
            SetColor(ctrl, keywords2, Color.Red);
            ctrl.SelectionStart = pos;
            ctrl.Select(pos, 0);
        }

        private static void SetHTMLTagColor(RichTextBox ctrl)
        {
            int start = 0;
            int end = 0;

            while (true)
            {
                start = ctrl.Text.IndexOf("<", end);
                if (start < 0)
后面还有 36 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。