public void ProcessFromHTTPResult(XmlNode node, int anid) { InitFields(); this.AnimeID = anid; this.CharID = int.Parse(AniDBHTTPHelper.TryGetAttribute(node, "id")); this.CharType = AniDBHTTPHelper.TryGetAttribute(node, "type"); this.CharName = AniDBHTTPHelper.TryGetProperty(node, "name"); this.CharDescription = AniDBHTTPHelper.TryGetProperty(node, "description"); this.EpisodeListRaw = AniDBHTTPHelper.TryGetProperty(node, "episodes"); this.PicName = AniDBHTTPHelper.TryGetProperty(node, "picture"); CreatorListRaw = ""; foreach (XmlNode nodeChild in node.ChildNodes) { if (nodeChild.Name == "seiyuu") { Raw_AniDB_Seiyuu seiyuu = new Raw_AniDB_Seiyuu(); if (nodeChild.Attributes["id"] != null) { string creatorid = nodeChild.Attributes["id"].Value; seiyuu.SeiyuuID = int.Parse(creatorid); if (CreatorListRaw.Length > 0) { CreatorListRaw += ","; } CreatorListRaw += creatorid.Trim(); } if (nodeChild.Attributes["picture"] != null) { seiyuu.PicName = nodeChild.Attributes["picture"].Value; } seiyuu.SeiyuuName = nodeChild.InnerText; Seiyuus.Add(seiyuu); } } }
public void ProcessFromHTTPResult(XmlNode node, int anid) { InitFields(); this.AnimeID = anid; this.CharID = int.Parse(AniDBHTTPHelper.TryGetAttribute(node, "id")); this.CharType = AniDBHTTPHelper.TryGetAttribute(node, "type"); this.CharName = AniDBHTTPHelper.TryGetProperty(node, "name"); this.CharDescription = AniDBHTTPHelper.TryGetProperty(node, "description"); this.EpisodeListRaw = AniDBHTTPHelper.TryGetProperty(node, "episodes"); this.PicName = AniDBHTTPHelper.TryGetProperty(node, "picture"); CreatorListRaw = ""; foreach (XmlNode nodeChild in node.ChildNodes) { if (nodeChild.Name == "seiyuu") { Raw_AniDB_Seiyuu seiyuu = new Raw_AniDB_Seiyuu(); if (nodeChild.Attributes["id"] != null) { string creatorid = nodeChild.Attributes["id"].Value; seiyuu.SeiyuuID = int.Parse(creatorid); if (CreatorListRaw.Length > 0) CreatorListRaw += ","; CreatorListRaw += creatorid.Trim(); } if (nodeChild.Attributes["picture"] != null) seiyuu.PicName = nodeChild.Attributes["picture"].Value; seiyuu.SeiyuuName = nodeChild.InnerText; Seiyuus.Add(seiyuu); } } }