Ejemplo n.º 1
0
        private void HandleGetCharactersResponse(string response, bool success)
        {
            if (success)
            {
                List <CharacterResponse> characters = JsonArray.Deserialize <CharacterResponse>(response, "characters").ToList();
                characterScreen.LoadCharacters(characters);
                return;
            }

            if (string.IsNullOrEmpty(response))
            {
                characterScreen.DisplayErrorMessage("No characters found.");
                return;
            }

            characterScreen.DisplayErrorMessage(MessageResponse.CreateFromJSON(response).message);
        }