public List<AdInfo> GetScreenAds() { List<AdInfo> ads = new List<AdInfo>(); var nodes = doc.SelectSingleNode("config/ads/screen"); if(nodes == null) { return ads; } foreach(XmlNode node in nodes) { AdInfo ad = new AdInfo() { ImageUrl = node.Attributes["imgUrl"].Value, ClickUrl = node.Attributes["clickUrl"].Value }; ads.Add(ad); } return ads; }
public List<AdInfo> GetBottomAds() { List<AdInfo> ads = new List<AdInfo>(); var nodes = doc.SelectSingleNode("config/ads/statusbar"); if(nodes == null) { return ads; } foreach(XmlNode node in nodes) { AdInfo ad = new AdInfo() { Text = node.Attributes["text"].Value, ClickUrl = node.Attributes["clickUrl"].Value }; ads.Add(ad); } return ads; }