private static IEnumerator Download_Async(LoaderRequest rRequest) { string rVersionURL = rRequest.Url; WebRequestAssist.LoaderRequest rWebVersionRequest = WebRequestAssist.DownloadFile(rVersionURL); yield return(rWebVersionRequest); if (rWebVersionRequest.Bytes == null || rWebVersionRequest.Bytes.Length == 0) { yield break; } ABVersion rVersion = new ABVersion(); using (var ms = new MemoryStream(rWebVersionRequest.Bytes)) { using (var br = new BinaryReader(ms)) { rVersion.Deserialize(br); } } rRequest.Version = rVersion; }
public static async Task <LoaderRequest> Download(string rURL) { LoaderRequest rRequest = new LoaderRequest(rURL); string rVersionURL = rRequest.Url; WebRequestAssist.LoaderRequest rWebVersionRequest = await WebRequestAssist.DownloadFile(rVersionURL); if (rWebVersionRequest.Bytes == null || rWebVersionRequest.Bytes.Length == 0) { return(null); } ABVersion rVersion = new ABVersion(); using (var ms = new MemoryStream(rWebVersionRequest.Bytes)) { using (var br = new BinaryReader(ms)) { rVersion.Deserialize(br); } } rRequest.Version = rVersion; return(rRequest); }