Beispiel #1
0
        public void SaveToken(string token)
        {
            var gameConfigSerializer = new GamesConfigurationSerializer();
            var gameConfiguration    = gameConfigSerializer.GetConfiguration(_gameType, _universum);

            gameConfiguration.Token = token;
            gameConfigSerializer.AddConfiguration(gameConfiguration);
        }
        private void AddOrEditConfiguration()
        {
            var messageBoxResult = MessageBox.Show("Are you sure you want to add/save the " + SelectedGameType + " Uniwersum " + Universum + " configuration?",
                                                   "Change configuration", MessageBoxButton.YesNo);

            if (messageBoxResult == MessageBoxResult.Yes)
            {
                var gameConfiguration = new GameConfigurationModel();
                gameConfiguration.GameType       = SelectedGameType;
                gameConfiguration.Login          = Login;
                gameConfiguration.BaseUri        = "whatever";
                gameConfiguration.Universum      = Universum;
                gameConfiguration.SpyProbeAmount = SpyProbeAmount;
                gameConfiguration.CurrentPlanet  = "1";
                gameConfiguration.Token          = "token";

                var configSerializer = new GamesConfigurationSerializer();
                configSerializer.AddConfiguration(gameConfiguration);
                LoadGamesConfigrations();
            }
        }