public void Download(IEnumerable <IFile> files) { foreach (var f in files) { if (!Directory.Exists(Path.GetDirectoryName(f.LocalPath))) { Directory.CreateDirectory(Path.GetDirectoryName(f.LocalPath)); } client.DownloadFile(f.DownloadUrl, f.LocalPath); DownloadedAFile?.Invoke(this, new FileDownloadedEventArgs(f)); } AllFinished?.Invoke(this, new EventArgs()); }
/// <summary> /// 文件传输完成 /// </summary> protected virtual void OnAllFinished() { AllFinished?.Invoke(this, new EventArgs()); }
protected virtual void OnAllFinished(AllFinishedEventArgs e) { AllFinished?.Invoke(this, e); }