void OnHttpDownloadCallback(Engine.HttpDownloadError eErrorCode, object data) { switch (eErrorCode) { case Engine.HttpDownloadError.HttpDownloadError_NetExp: { //object[] arr = data as object[]; if (m_DownFinishCallBack != null) { m_DownFinishCallBack(eErrorCode, m_curDownloadFile.strDestFile); // 返回错误 } break; } case Engine.HttpDownloadError.HttpDownloadError_Downloading: { object[] arr = data as object[]; if (m_DownProgressCallBack != null) { m_DownProgressCallBack(m_curDownloadFile.strURL, (int)arr[0], (int)arr[1]); } break; } case Engine.HttpDownloadError.HttpDownloadError_Completed: { //m_strMsg = string.Format("下载完成"); m_bDownload = false; if (m_DownFinishCallBack != null) { m_DownFinishCallBack(eErrorCode, m_curDownloadFile.strDestFile); m_DownProgressCallBack = null; m_DownFinishCallBack = null; } break; } //case Star.HttpDownloadError.HttpDownloadError_Connecting: // { // if (m_DownFinishCallBack != null) // { // m_DownFinishCallBack(0, m_curDownloadFile.strDestFile); // } // break; // } } }
public void ClearDownloadCallback(DownFinishDelegate finishCallback, DownProgressDelegate progressCallback) { m_DownFinishCallBack = null; m_DownProgressCallBack = null; }
public void SetDownloadCallback(DownFinishDelegate finishCallback, DownProgressDelegate progressCallback) { m_DownFinishCallBack += finishCallback; m_DownProgressCallBack += progressCallback; }