private static RssChannel ParseFile(IFile file) { Rss rssElement; using (StreamReader reader = file.CreateReader()) { var serializer = new XmlSerializer(typeof(Rss)); rssElement = (Rss)serializer.Deserialize(reader); } return(rssElement.channel.Single()); }
public static IList <string> ReadAllLines(this IFile self) { Contract.RequiresNotNull(self, "self"); var lines = new List <string>(); using (var reader = self.CreateReader()) { while (true) { var line = reader.ReadLine(); if (line == null) { break; } lines.Add(line); } } return(lines); }