예제 #1
0
 private void Remove(ImageUploadModel imageUploadModel)
 {
     _items.Remove(imageUploadModel);
     _removeCount++;
     if (!imageUploadModel.IsFailed && !imageUploadModel.IsCompleted && imageUploadModel.Ready > 0)
     {
         imageUploadModel.IsDeleting = true;
     }
     else
     {
         Delete(imageUploadModel);
     }
 }
예제 #2
0
 private void Upload(ImageUploadModel file)
 {
     if (!_cancel && !file.IsFailed && !file.IsCompleted)
     {
         using (var stream = file.FileInfo.OpenRead())
         {
             stream.Position = file.Ready;
             var len = (int)Math.Min(BUFFER_SIZE, stream.Length - stream.Position);
             var buffer = new byte[len];
             stream.Read(buffer, 0, len);
             _context.UploadFile(_path, file.Name, buffer, stream.Position == 0, UploadCallback, file);
         }
     }
 }
예제 #3
0
 private void Delete(ImageUploadModel file)
 {
     _context.DeleteFile(_path, file.Name, DeleteCallback, file);
 }