示例#1
0
        private void LoadFromXmlFile()
        {
            Directory.CreateDirectory(string.Concat((object)Directory.GetCurrentDirectory(), "\\Data"));
            string databaseFileName = "Database" + _gameRestClient.GetGameType() + _gameRestClient.GetUniversum();

            if (File.Exists(databaseFileName + ".xml"))
            {
                _dataManager.LoadFromXml(databaseFileName);
                ShowFilteredData();
                RefreshUsersPlanetsDetails();
            }
        }
示例#2
0
        public GetDataViewModel(IGameRestClient gameRestClient)
        {
            _gameRestClient            = gameRestClient;
            usersPlanets               = new ObservableCollection <UserPlanet>();
            GetSolarSystemsDataCommand = new DelegateCommand(async() => { await GetSolarSystemAsync(); }, CanExecute);
            LogInCommand               = new DelegateCommand(async() => { await LogIn(); }, CanExecute);
            SaveTokenCommand           = new DelegateCommand(SaveToken, CanExecute);
            LogOutCommand              = new DelegateCommand(LogOut, CanExecute);
            ShowGetTokenHelpCommand    = new DelegateCommand(ShowGetTokenHelp);
            ReadSavedLogin();
            PbData = new ProgresBarData();

            var dataManager = new UserPlanetDataManager(usersPlanets);

            usersPlanets = dataManager.LoadFromXml("Database" + _gameRestClient.GetGameType() + _gameRestClient.GetUniversum());

            SkanRange = new GalaxySkanRange();
        }