private static LineWidthHistogram GetHistogramForFile(string pFullFilePath) { var histogram = new LineWidthHistogram(); File .ReadAllLines(pFullFilePath) .ToList() .ForEach(line => histogram.AddLine(line)); return(histogram); }
public LineWidthHistogram Combine(LineWidthHistogram pHistogram) { foreach (var key in pHistogram.LineWidths.Keys) { if (LineWidths.ContainsKey(key)) { LineWidths[key] += pHistogram.LineWidths[key]; } else { LineWidths.Add(key, pHistogram.LineWidths[key]); } } return(this); }