private void FilterScenarios() { Scenarios.FilteredScenarioList = ScenarioCollectionDataAccess .ApplyAssetsFilter(Scenarios.ScenarioList, Scenarios.ScenarioFilter) .OrderBy(x => x.ScenarioTitle).ToList(); NotifyOfPropertyChange(() => Scenarios); }
private void GetScenarios(RouteModel RouteModel) { // Two step approach. In the first step we only do this for the packed scenarios, then we retrieve the unpacked scenarios, combine all in the database // Finally, we read the database and apply filtering and sorting. if (RouteModel.IsPacked) { Scenarios.ScenarioList = ScenarioCollectionDataAccess.ReadPackedListScenariosFromDisk( Settings.GameRoutesFolder, SelectedRoute.RouteGuid, true, false); ScenarioCollectionDataAccess.SaveScenariosBulkList(Scenarios.ScenarioList, true, false); } Scenarios.ScenarioList = ScenarioCollectionDataAccess .ReadScenariosFromDisk(Settings.GameRoutesFolder, SelectedRoute.RouteGuid, true, false); ScenarioCollectionDataAccess.SaveScenariosBulkList(Scenarios.ScenarioList, true, false); Scenarios.ScenarioList = ScenarioCollectionDataAccess .ReadScenariosFromDatabase(SelectedRoute.RouteGuid); Scenarios.FilteredScenarioList = ScenarioCollectionDataAccess .ApplyAssetsFilter(Scenarios.ScenarioList, Scenarios.ScenarioFilter) .OrderBy(x => x.ScenarioTitle).ToList(); }