示例#1
0
        private void BindSummary(Analyzer analyzer)
        {
            int validCategories = analyzer.Categories.Count(category => category.IsCompliant);
            int totalCategories = analyzer.Categories.Count;
            lblSummary.Text = string.Format("Compliance Score: {0} out of {1} Categories Compliant", validCategories, totalCategories);

            var report = (from a in analyzer.Categories
                          from b in a.Components
                          select new
                              {
                                  Category = a.Name,
                                  Component = b.Name,
                                  Compliant = b.IsCompliant,
                                  CompliantComponents = a.Components.Count(component => component.IsCompliant),
                                  TotalComponents = a.Components.Count
                              });

            gvSummary.DataSource = report;
            gvSummary.DataBind();
        }
示例#2
0
        private static Analyzer GetAnalyzer()
        {
            var analyzerSettings = new AnalyzerSettings()
                {
                    ConnectionString = WebConfigurationManager.ConnectionStrings[ConfigurationHelper.GetValueForKey("Database")].ConnectionString,
                    DatabaseName = ConfigurationHelper.GetValueForKey("Database"),
                    LogsPath = ConfigurationHelper.GetValueForKey("LogsPath"),
                    MaxChildItemsPerParent = ConfigurationHelper.GetValueForKey("MaxChildItemsPerParent"),
                    MaxVersionsPerItem = ConfigurationHelper.GetValueForKey("MaxVersionsPerItem"),
                    ContentStartPath = ConfigurationHelper.GetValueForKey("ContentStartPath")
                };

            var settings = StartUp.GetSystemSettings(analyzerSettings);
            var factory = new Factory(settings);

            var analyzer = new Analyzer(factory);
            analyzer.Analyze();
            return analyzer;
        }
示例#3
0
 private void BindCategories(Analyzer analyzer)
 {
     rCategories.DataSource = analyzer.Categories;
     rCategories.DataBind();
 }