Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reportData"></param>
        /// <param name="options"></param>
        /// <returns></returns>
        public override TableDefinition Content(ReportData reportData, Dictionary <string, string> options)
        {
            List <string> rowData = new List <string> {
                ""
            };

            //Set the table header
            rowData.AddRange(reportData.CurrentSnapshot.Technologies);

            //Set the result by module
            foreach (var mod in reportData.CurrentSnapshot.Modules)
            {
                var technologyLoc = MeasureUtility.GetSizingMeasureTechnologies(reportData.CurrentSnapshot, mod.Href, Constants.SizingInformations.CodeLineNumber.GetHashCode());

                rowData.Add(mod.Name);

                rowData.AddRange(reportData.CurrentSnapshot.Technologies.Select(techName => technologyLoc.FirstOrDefault(_ => _.Name == techName)).Select(result => (result != null) ? result.Value?.ToString(MetricFormat) : Constants.No_Value));
            }

            var resultTable = new TableDefinition
            {
                HasRowHeaders    = false,
                HasColumnHeaders = true,
                NbRows           = reportData.CurrentSnapshot.Modules.Count() + 1,
                NbColumns        = reportData.CurrentSnapshot.Technologies.Length + 1,
                Data             = rowData
            };

            return(resultTable);
        }