Ejemplo n.º 1
0
 public Mairi()
 {
     CompanyName = "迈日";
     Exts.Add(".xls");
     Exts.Add(".xlt");
     Exts.Add(".xlsx");
 }
Ejemplo n.º 2
0
 public AiChuang()
 {
     Exts.Add(".xls");
     Exts.Add(".xlt");
     Exts.Add(".xlsx");
     CompanyName = "艾创";
 }
Ejemplo n.º 3
0
        private void Classify(FileInfo fileInfo, long lines)
        {
            bool   classified = false;
            string path       = fileInfo.DirectoryName;
            string name       = fileInfo.Name;
            string ext        = fileInfo.Extension;

            ext = ext.ToLower();
            if (ext.Length > 1 && ext.StartsWith("."))
            {
                ext = ext.Substring(1);
            }
            //TODO: Any types you want to ignore.
            if (ext == "apk")
            {
                return;
            }
            if (ext == "bat")
            {
                return;
            }
            if (ext == "gitignore")
            {
                return;
            }
            if (ext == "gradlew")
            {
                return;
            }
            if (name == "gradlew")
            {
                return;
            }
            if (ext == "jar")
            {
                return;
            }
            if (ext == "jks")
            {
                return;
            }
            if (ext == "log")
            {
                return;
            }
            if (ext == "ttf")
            {
                return;
            }
            if (!Exts.ContainsKey(ext))
            {
                Exts.Add(ext, ext);
            }
            SubClassify("Total", path, name, ext, lines);

            //Types.
            switch (ext)
            {
            case "java":
                classified = true;
                SubClassify("Java", path, name, ext, lines);
                SubClassify("Program", path, name, ext, lines);
                break;

            case "kt":
                classified = true;
                SubClassify("Kotlin", path, name, ext, lines);
                SubClassify("Program", path, name, ext, lines);
                break;

            case "html":
                classified = true;
                SubClassify("Html", path, name, ext, lines);
                SubClassify("Data", path, name, ext, lines);
                break;

            case "json":
                classified = true;
                SubClassify("Json", path, name, ext, lines);
                SubClassify("Data", path, name, ext, lines);
                break;

            case "gradle":
                classified = true;
                SubClassify("Gradle", path, name, ext, lines);
                SubClassify("Build", path, name, ext, lines);
                break;

            case "properties":
                classified = true;
                SubClassify("Properties", path, name, ext, lines);
                SubClassify("Build", path, name, ext, lines);
                break;

            case "pro":
                classified = true;
                SubClassify("Pro", path, name, ext, lines);
                SubClassify("Build", path, name, ext, lines);
                break;

            case "xml":
                //These are sub classified separately as well into the different types of xml files.
                classified = true;
                SubClassify("Xml", path, name, ext, lines);
                break;

            case "jpg":
                //No line count for these.
                classified = true;
                SubClassify("Image", path, name, ext, lines);
                break;

            case "png":
                //No line count for these.
                classified = true;
                SubClassify("Image", path, name, ext, lines);
                break;

            default:
                break;
            }

            //Groups.
            if (path.Contains("common"))
            {
                SubClassify("Common", path, name, ext, lines);
                SubClassify("Code", path, name, ext, lines);
            }
            else if (path.Contains("features"))
            {
                SubClassify("Features", path, name, ext, lines);
                SubClassify("Code", path, name, ext, lines);
            }

            //Folders.
            if (ext == "xml")
            {
                if (name.Contains("AndroidManifest"))
                {
                    SubClassify("Manifest", path, name, ext, lines);
                    SubClassify("Markup", path, name, ext, lines);
                }
                else if (path.Contains("color"))
                {
                    SubClassify("Color", path, name, ext, lines);
                    SubClassify("Markup", path, name, ext, lines);
                }
                else if (path.Contains("drawable"))
                {
                    SubClassify("Drawable", path, name, ext, lines);
                    SubClassify("Markup", path, name, ext, lines);
                }
                else if (path.Contains("layout"))
                {
                    SubClassify("Layout", path, name, ext, lines);
                    SubClassify("Markup", path, name, ext, lines);
                }
                else if (path.Contains("menu"))
                {
                    SubClassify("Menu", path, name, ext, lines);
                    SubClassify("Markup", path, name, ext, lines);
                }
                if (path.Contains("mipmap"))
                {
                    SubClassify("Mipmap", path, name, ext, lines);
                    SubClassify("Markup", path, name, ext, lines);
                }
                else if (path.Contains("values"))
                {
                    SubClassify("Values", path, name, ext, lines);
                    SubClassify("Markup", path, name, ext, lines);
                }
            }

            //Other.
            if (!classified)
            {
                SubClassify("Other", path, name, ext, lines);
            }
        }
Ejemplo n.º 4
0
 public COMAU()
 {
     ShowFileOption = false;
     CompanyName    = "COMAU试漏仪";
     Exts.Add(".txt");
 }