Esempio n. 1
0
        public async Task UploadDownload(string path)
        {
            var lpath = new LocalPath(this.root.Value + path, this.root);
            var localFileSystemEvent = new LocalFileSystemEvent(lpath, "");

            try
            {
                var delete = new DeleteFileOnServerOperation(localFileSystemEvent, this.dropBoxCloudStorage);
                await delete.Execute(CancellationToken.None);
            }
            catch (Exception)
            {
            }

            var upload = new UploadFileToServerOperation(localFileSystemEvent, this.dropBoxCloudStorage);
            await upload.Execute(CancellationToken.None);


            var dropBoxEvent = new DropBoxEvent(lpath.ToServerPath(), "");
            var download     = new DownloadFileFromServer(dropBoxEvent, this.dropBoxCloudStorage, this.root);
            await download.Execute(CancellationToken.None);
        }
 public UploadFileToServerOperation(LocalFileSystemEvent @event, ICloudStorage cloudStore)
 {
     this.localPath  = @event.Path;
     this.cloudStore = cloudStore;
     this.Title      = "Upload : " + this.localPath.AsRelativeToRoot();
 }
Esempio n. 3
0
 public void Add(LocalFileSystemEvent @event)
 {
     this.Events.Add(@event);
 }
 public DeleteFileOnServerOperation(LocalFileSystemEvent @event, ICloudStorage cloudStore)
 {
     this.@event     = @event;
     this.cloudStore = cloudStore;
     this.Title      = "Deleting : " + Path.GetFileName(@event.Path.Value);
 }