Пример #1
0
        private static LineWidthHistogram GetHistogramForFile(string pFullFilePath)
        {
            var histogram = new LineWidthHistogram();

            File
            .ReadAllLines(pFullFilePath)
            .ToList()
            .ForEach(line => histogram.AddLine(line));

            return(histogram);
        }
Пример #2
0
        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);
        }