コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public static PatchInfoReader Load(string fileName)
 {
     return(PatchInfoReader.Load(XDocument.Load(fileName)));
 }