コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 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>();
 }
コード例 #4
0
 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;
 }
コード例 #5
0
 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;
 }
コード例 #6
0
 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;
 }
コード例 #7
0
 public SettingsViewModel(ISaveDataService saveDataService, INotificationService notificationService, IThemeService themeService) : base(saveDataService, notificationService, themeService)
 {
 }
コード例 #8
0
 public SaveDataCommand(ViewModelBase viewModel, ISaveDataService <T> saveDataService)
 {
     _viewModel       = viewModel;
     _saveDataService = saveDataService;
 }