public Song(GetLyricResult result) { this.name = result.lyricSong; this.artist = result.lyricArtist; this.album = result.lyricArtist; this.artWork = new Uri(result.lyricCovertArtUrl); this.lyrics = result.lyric; }
private GetLyricResult parseXmlLyricResult(string xml) { XDocument doc = XDocument.Parse(xml); XNamespace ns = "http://api.chartlyrics.com/"; GetLyricResult result = new GetLyricResult(); var item = doc.Element(ns + "GetLyricResult"); if (item.Element(ns + "TrackId") != null) { result.trackId = item.Element(ns + "TrackId").Value.ToString(); result.lyricChecksum = item.Element(ns + "LyricChecksum").Value.ToString(); result.lyricId = item.Element(ns + "LyricId").Value.ToString(); result.lyricSong = item.Element(ns + "LyricSong").Value.ToString(); result.lyricArtist = item.Element(ns + "LyricArtist").Value.ToString(); result.lyricUrl = item.Element(ns + "LyricUrl").Value.ToString(); result.lyricCovertArtUrl = item.Element(ns + "LyricCovertArtUrl").Value.ToString(); result.lyricRank = item.Element(ns + "LyricRank").Value.ToString(); result.lyricCorrectUrl = item.Element(ns + "LyricCorrectUrl").Value.ToString(); result.lyric = item.Element(ns + "Lyric").Value.ToString(); } return(result); }