UploadFinished() private method

private UploadFinished ( string parentId, string name, bool withError ) : Task
parentId string
name string
withError bool
return Task
Ejemplo n.º 1
0
 public async Task Start(CancellationToken cancellationToken)
 {
     using (var stream = await _tempData.OpenAsync())
     {
         bool withError = false;
         try
         {
             Item = await _fileSystem.Service.UploadFileAsync(_fileSystem.Drive.Id, ParentId, Name, stream, cancellationToken);
         }
         catch (OperationCanceledException)
         {
             withError = true;
             if (Item == null)
             {
                 throw new InvalidOperationException("The Item property must be set. The UploadFileAsync function must not return a NULL value.");
             }
             Item.Size = stream.Position;
             throw;
         }
         finally
         {
             _notifiedAsFinished = true;
             await _fileSystem.UploadFinished(ParentId, Name, withError);
         }
     }
 }