Esempio n. 1
0
        private void ShowGetData()
        {
            var restClientFactory = new GameRestClientFactory();
            var gameRestClient    = restClientFactory.CreateRestClient(_actualGameConfigurationModel.GameType, _actualGameConfigurationModel.Universum);

            CurrentView = new GetDataView(gameRestClient);
        }
Esempio n. 2
0
        private async Task CheckLogInStatus()
        {
            await Task.Run(async() =>
            {
                try
                {
                    LoginStatus status = OgameSkaner.RestClient.LoginStatus.LoggedOut;
                    while (true)
                    {
                        if (restClientChanged)
                        {
                            restClientChanged     = false;
                            var restClientFactory = new GameRestClientFactory();
                            _restClient           = restClientFactory.CreateRestClient(_actualGameConfigurationModel.GameType, _actualGameConfigurationModel.Universum);
                        }

                        status = _restClient.CheckLogInStatus();
                        if (status == OgameSkaner.RestClient.LoginStatus.LoggedIn)
                        {
                            LoginStatus          = "Logged In";
                            LoginRectangleCollor = "green";
                        }
                        if (status == OgameSkaner.RestClient.LoginStatus.LoggedOut)
                        {
                            LoginStatus          = "Logged Out";
                            LoginRectangleCollor = "red";
                        }

                        await Task.Delay(10000);
                    }
                }
                catch (RestException e)
                {
                    MessageBox.Show(e.Message);
                }
            });
        }