public historyBinCollection(historyPeriodCollection periods, Boolean includeBeforeAndAfter) { periodCollection = periods; beforeBin = new historyBin <T>(periodCollection.beforePeriod); afterBin = new historyBin <T>(periodCollection.afterPeriod); foreach (var period in periods.GetAllPeriods(includeBeforeAndAfter)) { if (period.periodName == historyTools.BINNAME_BEFORE) { Add(period.periodName, beforeBin); } else if (period.periodName == historyTools.BINNAME_AFTER) { Add(period.periodName, afterBin); } else { Add(period.periodName, new historyBin <T>(period)); } } }