Example #1
0
        private void OnTreadDownloadFile(ref DownloadData downloadInfo)
        {
            this.m_download_state = true;
            ProgressEventProxyUpdate pro_event_proxy = new ProgressEventProxyUpdate();

            pro_event_proxy.FileCompleteMethod = new Action <MemoryLoadCallbackFunc, AsyncCompletedEventArgs>(this.DownloadFileCompleted);
            pro_event_proxy.CallBack           = downloadInfo.callback;
            using (WebClient client = new WebClient())
            {
                client.DownloadFileCompleted += pro_event_proxy.DownloadFileCompleted;
                string save_path = downloadInfo.memory_quest.save_path;
                try
                {
                    client.DownloadFileAsync(new Uri(downloadInfo.memory_quest.RelativePath), save_path);
                }
                catch (Exception ex)
                {
                    Debug.LogError(ex.Message);
                }
                LogMgr.Log("Thread Download:{0}", downloadInfo.memory_quest.RelativePath);
            }
        }