/// <summary> /// Builds a dictionary of all elements for 1 report, specified by <paramref name="rh"/>. /// </summary> /// <param name="rh">The <see cref="ReportHeader"/> whose elements should be loaded.</param> /// <returns></returns> private Dictionary <string, int> BuildInUseElementsForCurrentReport(ReportHeader rh) { if (rh.ReportType == ReportHeaderType.Sheet || rh.ReportType == ReportHeaderType.Notes) { if (!this.uniqueReportElements.ContainsKey(rh.XmlFileName) || this.uniqueReportElements == null || this.uniqueReportElements.Count == 0) { InstanceReport report = InstanceReport.LoadXml(Path.Combine(this.currentReportDirectory, rh.XmlFileName)); string[] uniqueElements = report.GetUniqueInUseElements(); this.uniqueReportElements[rh.XmlFileName] = new List <string>(uniqueElements); } } Dictionary <string, int> reportUniqueElements = new Dictionary <string, int>(); if (this.uniqueReportElements.ContainsKey(rh.XmlFileName) && this.uniqueReportElements.Count > 0) { foreach (string key in this.uniqueReportElements[rh.XmlFileName]) { reportUniqueElements[key] = 1; } } return(reportUniqueElements); }