예제 #1
0
        private static DogImage ParseRandomImage(string json)
        {
            DogImage result;
            JObject  dogApiResponse = JObject.Parse(json);
            string   message        = dogApiResponse["message"].ToString();

            Uri dogImageUrl = new Uri(message);

            result = new DogImage
            {
                Url   = message,
                Breed = new Breed(dogImageUrl.Segments[2].Replace("/", ""))
            };

            return(result);
        }
예제 #2
0
 public QuizQuestion(DogImage dogImage, int optionsNumber)
 {
     Image   = dogImage;
     Options = LoadOptions(dogImage.Breed, optionsNumber);
 }