Exemple #1
0
        public CorrectResults(JsonObject results)
        {
            if (results == null)
            {
                throw new ArgumentNullException("results");
            }
            if (results.Keys.Count != 0)
            {
                Artist = results.Keys.First();
                var artistObject = results.Get <JsonObject> (Artist);

                ArtistImageInfos = artistObject.Get <JsonArray> ("musiclogo")
                                   .Select(elem => new ArtistImageInfo(elem as JsonObject))
                                   .ToArray();
            }
            else
            {
                ArtistImageInfos = new ArtistImageInfo [] {};
                Hyena.Log.Debug("No results in CorrectResults constructor");
            }
        }
        public CorrectResults(JsonObject results)
        {
            if (results == null) {
                throw new ArgumentNullException ("results");
            }
            if (results.Keys.Count != 0) {
                Artist = results.Keys.First ();
                var artistObject = results.Get<JsonObject> (Artist);

                ArtistImageInfos = artistObject.Get<JsonArray> ("musiclogo")
                    .Select (elem => new ArtistImageInfo (elem as JsonObject))
                    .ToArray ();
            } else {
                ArtistImageInfos = new ArtistImageInfo [] {};
                Hyena.Log.Debug ("No results in CorrectResults constructor");
            }
        }