public static PatchInfoReader Download(string address) { PatchInfoReader patchInfoReader; using (MemoryStream memoryStream = new MemoryStream((new MyWebClient()).DownloadData(address))) { patchInfoReader = PatchInfoReader.Load(XDocument.Load(memoryStream)); } return(patchInfoReader); }
private static PatchInfoReader Load(XContainer xmlDocument) { PatchInfoReader patchInfoReader = new PatchInfoReader() { Entries = from entry in xmlDocument.Descendants("Files").Elements <XElement>("File") select new PatchInfoEntry(Path.GetFileName(entry.Attribute("Name").Value), (long)entry.Attribute("Size"), Convert.ToInt32(entry.Attribute("Checksum").Value, 16), Convert.ToInt32(entry.Attribute("FileTime").Value, 16), (uint?)entry.Attribute("ChecksumSize"), (uint?)entry.Attribute("ChecksumCount")) }; return(patchInfoReader); }
public static PatchInfoReader Load(string fileName) { return(PatchInfoReader.Load(XDocument.Load(fileName))); }