Created
June 11, 2012 07:38
-
-
Save biac/2908926 to your computer and use it in GitHub Desktop.
Kujian - 参加者.cs
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
public class 参加者 | |
{ | |
private const string OriginalData = @"…略(約40人分)…"; | |
public string Name { get; set; } | |
public string ImageUrl { get; set; } | |
public static IList<参加者> Create() | |
{ | |
XName img = XName.Get("img"); | |
XName attr_alt = XName.Get("alt"); | |
XName attr_src = XName.Get("src"); | |
var xDoc = XDocument.Parse(OriginalData); | |
var list = xDoc.Descendants(img).Select((e) => new 参加者() | |
{ | |
Name = e.Attribute(attr_alt).Value, | |
ImageUrl = e.Attribute(attr_src).Value, | |
}).ToList(); | |
return list; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment