private void loadSimulations(Simulation simulation) { if (simulation == null) { return; } //updating results may triggered update of has changed flag that is not accurate. We save the original state and update it at the end var hasChanged = simulation.HasChanged; //Only load results for individual simulations if (simulation.IsAnImplementationOf <IndividualSimulation>()) { _simulationResultsLoader.LoadResultsFor(simulation.DowncastTo <IndividualSimulation>()); } else if (simulation.IsAnImplementationOf <PopulationSimulation>()) { _simulationAnalysesLoader.LoadAnalysesFor(simulation.DowncastTo <PopulationSimulation>()); } //in all cases, load the charts _simulationChartsLoader.LoadChartsFor(simulation); simulation.HasChanged = hasChanged; }
private void loadSimulations(Simulation simulation) { if (simulation == null) { return; } //Only load results for individual simulations if (simulation.IsAnImplementationOf <IndividualSimulation>()) { _simulationResultsLoader.LoadResultsFor(simulation.DowncastTo <IndividualSimulation>()); } else if (simulation.IsAnImplementationOf <PopulationSimulation>()) { _simulationAnalysesLoader.LoadAnalysesFor(simulation.DowncastTo <PopulationSimulation>()); } //in all cases, load the charts _simulationChartsLoader.LoadChartsFor(simulation); }