public static Series FromXml(XElement elm) { var serie = new Series(); if (elm != null) { serie.MediaType = elm.Element("class").Value; serie.SeriesId = long.Parse(elm.Element("series_id").Value); serie.Url = elm.Element("url").Value; serie.Name = elm.Element("name").Value; serie.MediaType = elm.Element("media_type").Value; serie.Description = elm.Element("description").Value; //serie.MediaCount = int.Parse(elm.Element("media_count").Value); var landscape = elm.Element("landscape_image"); if (landscape != null) { serie.LandscapeImage = ImageSet.FromXml(landscape); } var portrait = elm.Element("portrait_image"); if (portrait != null) { serie.PortraitImage = ImageSet.FromXml(portrait); } } return(serie); }
public static Media FromXml(XElement elm) { var media = new Media(); if (elm != null) { media.MediaType = elm.Element("class").Value; media.MediaId = int.Parse(elm.Element("media_id").Value); media.CollectionId = long.Parse(elm.Element("collection_id").Value); media.SeriesId = long.Parse(elm.Element("series_id").Value); media.EpisodeNumber = elm.Element("episode_number").Value; media.Name = elm.Element("name").Value; media.MediaType = elm.Element("media_type").Value; media.Description = elm.Element("description").Value; media.ScreenshotImage = ImageSet.FromXml(elm.Element("screenshot_image")); } return(media); }