public HttpHelper(HttpHelperCallBack m_callBack = null, object data = null) { this.m_callBack = m_callBack; this.data = data; m_size = 0; m_curSize = 0; }
public void DownLoad(string url, string filePath, HttpHelperCallBack callBack, object data = null) { if (string.IsNullOrEmpty(url) || string.IsNullOrEmpty(filePath)) { if (callBack != null) { callBack(new HttpHelperRet(false, "'url' or 'filePath' is null"), data); } return; } HttpCallBack cb = new HttpCallBack(callBack, data); HttpHelper httpHelper = new HttpHelper(OnDownLoadCallBack, cb); HttpDownLoad dl = new HttpDownLoad(httpHelper, url, filePath); HttpDownLoadList.Add(dl); }
public void UpLoad(string url, string filePath, HttpHelperCallBack callBack, object data = null, string userId = "") { if (string.IsNullOrEmpty(filePath) || string.IsNullOrEmpty(url)) { if (callBack != null) { callBack(new HttpHelperRet(false, "'url' or 'filePath' is null"), data); } return; } HttpCallBack cb = new HttpCallBack(callBack, data); HttpHelper httpHelper = new HttpHelper(OnUpLoadCallBack, cb); HttpUpLoad ul = new HttpUpLoad(httpHelper, url, filePath, userId); HttpUpLoadList.Add(ul); }
public HttpCallBack(HttpHelperCallBack mHttpHelperCallBack, object data = null, HttpHelperRet ret = null) { this.mHttpHelperCallBack = mHttpHelperCallBack; this.data = data; this.ret = ret; }