public void Check()
        {
            #region 检查质检目录下的所有文件夹是否存在
            var resultComplete = new ResultComplete(ParameterManager2.Folder)
            {
                Children = ParameterManager2.Folders
            };
            resultComplete.Check();

            QuestionManager2.AddRange(resultComplete.Messages.Select(e =>
                                                                     new Question2
            {
                Code         = "110101",
                Name         = RuleName,
                CheckProject = CheckProject2.目录及文件规范性,
                Description  = e,
                Folder       = ParameterManager2.Folder
            }).ToList());
            #endregion

            var tool = new FileStandard {
                Files = ParameterManager2.Files
            };
            tool.Check2();
            QuestionManager2.AddRange(tool.List.Select(e => new Question2
            {
                Code         = "110102",
                Name         = RuleName,
                CheckProject = CheckProject2.目录及文件规范性,
                Description  = e,
                Folder       = ParameterManager2.Folder
            }
                                                       ).ToList());
        }
Esempio n. 2
0
        public void Check()
        {
            #region  检查目录文件夹
            var resultComplete = new ResultComplete(ParameterManager.Folder)
            {
                Children = ParameterManager.ChildrenFolder
            };
            resultComplete.Check();
            QuestionManager.AddRange(
                resultComplete.Messages.Select(e =>
                                               new Question
            {
                Code        = ID,
                Name        = RuleName,
                Project     = CheckProject.目录及文件规范性,
                Description = e,
                ShowType    = ShowType.Folder,
                Folder      = ParameterManager.Folder
            }).ToList());
            #endregion
            #region  各个文件夹下面的文件是否丢失 是否缺失


            var tool = new FileStandard {
                Files = ParameterManager.ChildrenFiles
            };
            tool.Check();
            QuestionManager.AddRange(
                tool.List.Select(e =>
                                 new Question {
                Code        = "1102",
                Name        = RuleName,
                Project     = CheckProject.目录及文件规范性,
                Description = string.Format(@"文件:{0}不存在,请去除多余的空格,并注意全角\半角符号符合规范", e),
                ShowType    = ShowType.Folder,
                Folder      = System.IO.Path.GetDirectoryName(e)
            }).ToList());
            //Parallel.ForEach(tools, tool =>
            //{
            //    tool.Check();
            //    QuestionManager.AddRange(tool.List.Select(e => new Question { Code = "1102", Name = RuleName, Project = CheckProject.目录及文件规范性, Description = e }).ToList());
            //});
            #endregion
        }