private async Task ImportInternal() { ISaveDataService saveDataService = ServicesContainer.GetService <ISaveDataService>(); IList <SaveDataInfo> saveDataInfoItems = saveDataService.GetSaveInfo(); IList <Task <IList <DecorationsSaveSlotInfo> > > allTasks = saveDataInfoItems .Select(ReadSaveData) .ToList(); await Task.WhenAll(allTasks); IList <DecorationsSaveSlotInfo> allSlots = allTasks .SelectMany(x => x.Result) .ToList(); DecorationsSaveSlotInfo selected; if (allSlots.Count > 1) { selected = saveSlotInfoSelector(allSlots); if (selected == null) { return; } } else { selected = allSlots[0]; } MessageBox.Show("Save data import done.", "Import", MessageBoxButton.OK); ApplySaveDataDecorations(selected); }
private async Task ImportInternal() { if (gameEquipments == null) { gameEquipments = LoadGameEquipments(); if (gameEquipments == null) { return; } } ISaveDataService saveDataService = ServicesContainer.GetService <ISaveDataService>(); if (saveDataService == null) { return; } IList <SaveDataInfo> saveDataInfoItems = saveDataService.GetSaveInfo(); if (saveDataInfoItems == null) { return; } IList <Task <IList <EquipmentsSaveSlotInfo> > > allTasks = saveDataInfoItems .Select(ReadSaveData) .ToList(); await Task.WhenAll(allTasks); IList <EquipmentsSaveSlotInfo> allSlots = allTasks .SelectMany(x => x.Result) .ToList(); EquipmentsSaveSlotInfo selected; if (allSlots.Count > 1) { selected = saveSlotInfoSelector(allSlots); if (selected == null) { return; } } else { selected = allSlots[0]; } System.Windows.MessageBox.Show("Save data import done.", "Import", System.Windows.MessageBoxButton.OK); ApplySaveDataEquipments(selected); }
public ModeSelectionViewModel(IDispatchOnUIThread dispatcherService , IDataService dataService , Interfaces.IDialogService dialogService , ISaveDataService saveDataService) { _dispatcherService = dispatcherService; _dataService = dataService; _dialogService = dialogService; _saveDataService = saveDataService; _navigationService = ServiceLocator.Current.GetInstance <INavigationService>(); LsTrackingSetting = new List <TrackingSetting>(); }
public DetailSeekiosViewModel(IDataService dataService , Interfaces.IDialogService dialogService , ISaveDataService saveDataService , INavigationService navigationService , IDispatchOnUIThread dispatcherService) { _dataService = dataService; _dialogService = dialogService; _navigationService = navigationService; _saveDataService = saveDataService; _dispatcherService = dispatcherService; ActivityNeedsUIToBeUpdated = false; IsSeekiosDeleted = false; }
public ListSeekiosViewModel(IDataService dataService , Interfaces.IDialogService dialogService , ISaveDataService saveDataService , IDispatchOnUIThread dispatcherService , ILocalNotificationService localNotificationService) { _dataService = dataService; _dialogService = dialogService; _saveDataService = saveDataService; _dispatcherService = dispatcherService; _localNotificationService = localNotificationService; _navigationService = ServiceLocator.Current.GetInstance <INavigationService>(); ActivityNeedsUIToBeUpdated = false; }
public MapViewModelBase(IDispatchOnUIThread dispatcherService , IDataService dataService , Interfaces.IDialogService dialogService , ILocalNotificationService localNotificationService) { _dispatcherService = dispatcherService; _dataService = dataService; _dialogService = dialogService; _localNotificationService = localNotificationService; _saveDataService = GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.GetInstance <ISaveDataService>(); LsSeekiosAlertState = new HashSet <int>(); LsSeekiosOnDemand = new List <SeekiosOnDemand>(); LsSeekiosOnTracking = new List <SeekiosOnTracking>(); IsInNormalMode = true; }
public SettingsViewModel(ISaveDataService saveDataService, INotificationService notificationService, IThemeService themeService) : base(saveDataService, notificationService, themeService) { }
public SaveDataCommand(ViewModelBase viewModel, ISaveDataService <T> saveDataService) { _viewModel = viewModel; _saveDataService = saveDataService; }