/// <summary> /// Parses the specified <paramref name="obj"/> into an instance of <see cref="InstagramCarouselMedia"/>. /// </summary> /// <param name="obj">The instance of <see cref="JObject"/> to be parsed.</param> /// <returns>Returns an instance of <see cref="InstagramCarouselMedia"/>.</returns> public static InstagramCarouselMedia Parse(JObject obj) { if (obj == null) { return(null); } switch (obj.GetString("type")) { case "image": return(InstagramCarouselImage.Parse(obj)); case "video": return(InstagramCarouselVideo.Parse(obj)); default: return(new InstagramCarouselMedia(obj)); } }
/// <summary> /// Gets whether the media is an image - AKA an instance of <see cref="InstagramCarouselImage"/>. /// </summary> /// <param name="image">The instance of <see cref="InstagramImage"/> if an image, otherwise <code>null</code>.</param> /// <returns><code>true</code> if this media is an instance of <see cref="InstagramCarouselImage"/>, otherwise <code>false</code>.</returns> public bool IsImage(out InstagramCarouselImage image) { image = this as InstagramCarouselImage; return(image != null); }