Created
July 20, 2012 17:58
-
-
Save ChuckSavage/3152271 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DebuggerDisplay("{Title}, Desc({Description}), Link({Link})")] | |
public class Item | |
{ | |
public Item(XElement x) | |
{ | |
Title = x.Element("title").Value; | |
Description = x.Element("description").Value; | |
XElement link = x.Element("link"); | |
if(null != link) | |
Link = link.Value; | |
XElement cc = x.Element("channelContents"); | |
if (null != cc) | |
Items = cc.Elements("item").Select(c => new Item(c)).ToArray(); | |
} | |
public string Title; | |
public string Description; | |
public string Link; | |
public Item[] Items; | |
} | |
// You fill it using: | |
Items[] items = XElement.Load(file).Elements("item").Select(i => new Item(i)).ToArray(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment