/// <summary> /// 子任务线程完成触发事件通知方法 /// </summary> /// <param name="args"></param> protected void SubFinishNotity(HttpLoadFileEventArgs args) { if (SubFinished != null) { SubFinished(this, args); } }
/// <summary> /// 子任务线程出错触发事件通知方法 /// <param name="args"></param> protected void SubErrorNotify(HttpLoadFileEventArgs args) { if (Error != null) { Error(this, args); } }
/// <summary> /// 全局任务出错触发事件通知方法 /// </summary> protected void AllErrorNotify() { if (Error != null) { HttpLoadFileEventArgs args = new HttpLoadFileEventArgs(); args.TaskCount = taskCount; args.SourceUrl = sourceUrl; args.SaveFilePath = saveFilePath; args.IsFinish = false; args.ErrMsg = errMsg; Error(this, args); } }
protected void ErrorNotify() { if (Error != null) { HttpLoadFileEventArgs args = new HttpLoadFileEventArgs(); args.TaskIndex = this.taskIndex; args.IsFinish = false; args.ErrMsg = errMsg; args.SourceUrl = httpLoadFile.SourceUrl; args.SaveFilePath = httpLoadFile.SaveFilePath; args.TaskCount = httpLoadFile.TaskCount; Error(this, args); } }
/// <summary> /// 全部任务完成触发事件通知方法 /// </summary> protected void AllFinishNotify() { if (AllFinished != null) { HttpLoadFileEventArgs args = new HttpLoadFileEventArgs(); args.TaskCount = taskCount; args.SourceUrl = sourceUrl; args.SaveFilePath = saveFilePath; args.IsFinish = true; args.ErrMsg = "No Error!"; args.TaskIndex = taskCount; AllFinished(this, args); } }
protected void HttpLoadFile_Finished(object sender, HttpLoadFileEventArgs e) { isFinishList[e.TaskIndex] = e.IsFinish; SubFinishNotity(e); }
protected void HttpLoadFile_Error(object sender, HttpLoadFileEventArgs e) { errMsg = e.ErrMsg; SubErrorNotify(e); }