Exemplo n.º 1
0
 public HttpHelper(HttpHelperCallBack m_callBack = null, object data = null)
 {
     this.m_callBack = m_callBack;
     this.data       = data;
     m_size          = 0;
     m_curSize       = 0;
 }
Exemplo n.º 2
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);
    }
Exemplo n.º 3
0
    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);
    }
Exemplo n.º 4
0
 public HttpCallBack(HttpHelperCallBack mHttpHelperCallBack, object data = null, HttpHelperRet ret = null)
 {
     this.mHttpHelperCallBack = mHttpHelperCallBack;
     this.data = data;
     this.ret  = ret;
 }