protected override ICommand ReplaceTemplatesCommand(IWithChartTemplates withChartTemplates, IEnumerable <CurveChartTemplate> curveChartTemplates) { withChartTemplates.RemoveAllChartTemplates(); curveChartTemplates.Each(withChartTemplates.AddChartTemplate); return(new OSPSuiteEmptyCommand <IOSPSuiteExecutionContext>()); }
protected override ICommand ReplaceTemplatesCommand(IWithChartTemplates withChartTemplates, IEnumerable <CurveChartTemplate> curveChartTemplates) { if (withChartTemplates.IsAnImplementationOf <IMoBiSimulation>()) { return(new ReplaceSimulationTemplatesCommand(withChartTemplates.DowncastTo <IMoBiSimulation>(), curveChartTemplates).Run(_context)); } return(updateChartTemplates(withChartTemplates, x => { withChartTemplates.RemoveAllChartTemplates(); curveChartTemplates.Each(withChartTemplates.AddChartTemplate); })); }