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);
         }
     }));
 }
コード例 #2
0
 private void onComplete()
 {
     MergeCompleted?.Invoke(this, new EventArgs());
 }
コード例 #3
0
 public void OnMergeCompleted(MergeEventArgs e)
 {
     MergeCompleted?.Invoke(this, e);
 }
コード例 #4
0
ファイル: Merger.cs プロジェクト: Verlassenn/ExtractorSharp
 private void OnMergeCompleted(MergeEventArgs e) => MergeCompleted?.Invoke(this, e);
コード例 #5
0
        /// <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);
        }