private Task MergePartialFiles() { return(Task.Run(() => { using (var fs = File.Create(FilePath)) { foreach (var fileChunk in Ranges.Where(x => x.TotalBytesReceived > 0).OrderBy(x => x.Start) .Select(x => x.FilePath)) { var buffer = new byte[5 * 1024]; FileStream chunkStrem; while (!TryOpen(fileChunk, out chunkStrem)) { Thread.Sleep(500); } WriteFile(chunkStrem, fs); } MergeCompleted.Raise(this, EventArgs.Empty, aop); } })); }
private void onComplete() { MergeCompleted?.Invoke(this, new EventArgs()); }
public void OnMergeCompleted(MergeEventArgs e) { MergeCompleted?.Invoke(this, e); }
private void OnMergeCompleted(MergeEventArgs e) => MergeCompleted?.Invoke(this, e);
/// <summary> /// Called when a merge has been completed successfully. /// </summary> /// <param name="changes">The changes.</param> /// <param name="commitId">The commit identifier.</param> internal void OnMergeCompleted(ObjectRepositoryChangeCollection changes, ObjectId commitId) { var args = new MergeCompletedEventArgs(changes, commitId); MergeCompleted?.Invoke(this, args); }