/// <summary> /// Adds a report to the global report usage hash table. /// </summary> public static void MergeReport(ReportUsage RU) { if (s_reportUsage.ContainsKey(RU.GetReportString())) { s_reportUsage[RU.GetReportString()].IncrementCount(); } else { s_reportUsage.Add(RU.GetReportString(), RU); } }
/// prints out all reports, sorted by m_str public static string GetReport(bool includeCount) { StringBuilder sb = new StringBuilder(); SortedDictionary <string, ReportUsage> sortedReportUsage = new SortedDictionary <string, ReportUsage>(s_reportUsage); foreach (KeyValuePair <string, ReportUsage> kvp in sortedReportUsage) { ReportUsage ru = kvp.Value; sb.Append(ru.GetReportString()); if (includeCount) { sb.AppendFormat(" <!-- used {0} time{1} -->", ru.GetReportCount(), (ru.GetReportCount() == 1) ? "" : "s"); } sb.AppendLine(); } return(sb.ToString()); }