コード例 #1
0
        private ReportSection CreateMainSection()
        {
            var section = new ReportSection()
            {
                Headings = new string[] { "User's Name", "Number of Messages" },
                Content  = countingResult
            };

            return(section);
        }
コード例 #2
0
        public void AddSection(ReportSection section)
        {
            Debug.Assert(section != null, "section != null - section should not be null");
            if (section == null)
            {
                throw new ArgumentNullException("section cannot be null.");
            }

            sections.Add(section);
        }
コード例 #3
0
        protected override ReportSection CreateMainSection()
        {
            var sortedContributions = contrinutions.OrderBy(item => item.Key);

            foreach (var record in sortedContributions)
            {
                reportContent.Add(new string[] { record.Key.ToString("HH"), record.Value.ToString() });
            }

            var mainSection = new ReportSection()
            {
                Headings = new string[] { "Hour", "Number of Messages" },
                Content  = reportContent
            };

            return(mainSection);
        }
コード例 #4
0
        protected override ReportSection CreateMainSection()
        {
            string date;

            var sortedContributions = contrinutions.OrderBy(record => record.Key);

            foreach (var record in sortedContributions)
            {
                date = GetFormattedDate(record.Key);
                reportContent.Add(new string[] { date, record.Value.ToString() });
            }

            var mainSection = new ReportSection()
            {
                Headings = new string[] { "Month", "Number of Messages" },
                Content  = reportContent
            };

            return(mainSection);
        }