private void BeginOnFileZipped(object sender, EventArgs e) { ZipFileCreated myZipFile = (ZipFileCreated)e; Console.WriteLine("My ZipFile was created, name = {0}, size = {1}", myZipFile.filePath, myZipFile.fileSize); SendZipFile sendZipFile = new SendZipFile(myZipFile, mGitUtilCommand); }
private async Task CreateZipArchive() { /* * Func<long> function = new Func<long>(() => ZipIt()); * long result = await Task.Run(function).ContinueWith(OnZipFileFinished); */ Func <ZipFileCreated> zipFunction = new Func <ZipFileCreated>(() => ZipIt()); ZipFileCreated myZipFile = await Task.Run(zipFunction).ContinueWith(OnZipFileFinished); }
private ZipFileCreated OnZipFileFinished(Task <ZipFileCreated> arg) { Console.WriteLine("OnZipFileFinished says: {0}", arg.Result.ToString()); ZipFileCreated fileCreated = new ZipFileCreated(); fileCreated.filePath = arg.Result.filePath; fileCreated.fileSize = arg.Result.fileSize; OnFileZipped(fileCreated); return(fileCreated); }
protected virtual void OnFileZipped(ZipFileCreated zipFileCreated) { eventFileZipped?.Invoke(this, zipFileCreated); }
public SendZipFile(ZipFileCreated zipFile, GitUtilCommnad gitUtilCommand) { this.mGitutilCommand = gitUtilCommand; this.mZipFileCreated = zipFile; SendAsync(); }