Пример #1
0
        static void Main(string[] args)
        {
            string auditFile = @"auditvalues.json";

            if (args.Length == 1)
            {
                auditFile = args[0];
            }
            AuditSectionContainer ac = JsonConvert.DeserializeObject <AuditSectionContainer>(File.ReadAllText(auditFile));

            var files = ac.GetFilteredFiles(@"..\.", SearchOption.AllDirectories);

            foreach (var item in files)
            {
                Configuration c = new Configuration(item.FullName, item.FullName + ".sample.tmp");
                Console.WriteLine();

                c.PerformAudit(ac);
                c.DisplayAuditResults(true);
                //c.DisplayAuditResults(false);

                c.UpdateAuditResults();
                Console.WriteLine("\n==============================================================================\n");
            }
        }
Пример #2
0
 public void PerformAudit(AuditSectionContainer audit)
 {
     foreach (var item in audit.Sections)
     {
         Section s = SectionData.GetSection(item.Name);
         if (s != null)
         {
             s.CompareThisAgainst(item);
         }
         else
         {
             Section newSection = new Section(item.Name, SectionStatus.missing);
             foreach (var i in item.Items)
             {
                 newSection.Items.Add(new SectionItem(i.Name, string.Empty, i.Value, SectionItemStatus.missing));
             }
             SectionData.AddSection(newSection);
         }
     }
 }