/// <summary> /// 上传失败委托. /// </summary> /// <param name="iUploader">上传器.</param> /// <param name="iTargetInfo">上传目标信息.</param> /// <param name="iRetries">剩余重试次数.</param> /// <param name="iError">错误信息.</param> public void OnUploadFailed(Uploader iUploader, UploadItem iTargetInfo, int iRetries, List <ErrorDetail> iErrors) { lock (_errorLock) { UtilsLog.Error("OnUploadFailed", "{0} State:{1} Retries:{2} Detail:{3}", iTargetInfo.toString(), this._State, iRetries, iErrors.ToString()); this._errors.AddRange(iErrors); this._State = TRunState.Error; if (iUploader != null) { iUploader.Dispose(); GC.Collect(); } } }
/// <summary> /// 上传成功委托. /// </summary> /// <param name="iUploader">上传器.</param> /// <param name="iTargetInfo">下载目标信息.</param> /// <param name="iIsManifest">manifest标志位.</param> /// <param name="iRetries">剩余重试次数.</param> public void OnUploadSuccessed(Uploader iUploader, UploadItem iTargetInfo, int iRetries) { UtilsLog.Info("OnUploadSuccessed", "No:{0} State:{1} Retries:{2}", iTargetInfo.toString(), this._State, iRetries); UploadList.GetInstance().UploadCompleted(iTargetInfo.ID, iTargetInfo.FileType); if (null != iUploader) { iUploader.Dispose(); GC.Collect(); } lock (_uploaderCountLock) { --this.UploaderCount; } }