public void VerifyIntegrity() { foreach (var value in Enum.GetValues(typeof(TimelineHistoricPeriod))) { if (HistoricPeriods.TryGetValue((TimelineHistoricPeriod)value, out var historicPeriod)) { if (historicPeriod == null) { HistoricPeriods[(TimelineHistoricPeriod)value] = new HistoricPeriod(); } continue; } HistoricPeriods.Add((TimelineHistoricPeriod)value, new HistoricPeriod()); } }
public void AddHistoricPeriod(TimelineHistoricPeriod historicPeriodEnum, HistoricPeriod historicPeriod) { if (historicPeriod == null) { return; } if (HistoricPeriods.ContainsKey(historicPeriodEnum)) { HistoricPeriods[historicPeriodEnum] = historicPeriod; } else { HistoricPeriods.Add(historicPeriodEnum, historicPeriod); } foreach (var timelineEventPair in historicPeriod) { AllEventsList.Add(timelineEventPair.Value); } }