//private bool _isDataObsolete = true; public NetDiskFileNodeViewModel(IUnityContainer container, INetDiskFile netDiskFile) : base(container) { _netDiskFile = netDiskFile; DeleteFileCommand = new Command(DeleteFileCommandExecuteAsync); DownloadFileCommand = new Command(DownloadFileCommandExecuteAsync); }
private DownloadingFile(INetDiskUser owner, INetDiskFile file, IDownloader downloader) { Owner = owner; File = file; DownloadInfo = downloader; BindableDownloader = downloader.ToBindable(Application.Current.Dispatcher); Operations = downloader.AsManaged("any-drive"); // TODO: To const. ArddFilePath = $"{downloader.Context.LocalPath}{Constants.DownloadInfoFileExtension}"; }
private DownloadingFile(INetDiskUser owner, INetDiskFile file, IDownloader downloader) { Owner = owner; File = file; DownloadInfo = downloader; BindableDownloader = downloader.ToBindable(Application.Current.Dispatcher); Operations = downloader.AsManaged("net-disk"); // TODO: To const. ArddFilePath = $"{downloader.Context.LocalPath}.ardd"; }
private TransferItem MockDownload(INetDiskFile file, FileLocator to) { var downloader = FileTransferService .GetDownloaderBuilder() .UseSixCloudConfigure() .From(file.Path) .To(to) .Build(); return(new TransferItem(downloader) { File = file, Owner = this }); }
public override IDownloadingFile Download(INetDiskFile from, FileLocator to) { var downloader = FileTransferService .GetDownloaderBuilder() .UseSixCloudConfigure() .Configure(localPath => localPath.GetUniqueLocalPath(path => File.Exists(path) || File.Exists($"{path}{ArddFileExtension}"))) .From(new RemotePathProvider(this, from.Path)) .To(Path.Combine(to, from.Path.FileName)) .Build(); var result = DownloadingFile.Create(this, from, downloader); SaveDownloadingFile(result); return(result); }
public NetDiskFileNodeViewModel(IUnityContainer container, IMountUserRepository mountUserRepository, INetDiskFile netDiskFile) : base(container) { _mountUserRepository = mountUserRepository; _netDiskFile = netDiskFile; DeleteFileCommand = new Command(DeleteFileCommandExecuteAsync); DownloadFileCommand = new Command(DownloadFileCommandExecuteAsync); EventAggregator.GetEvent <DownloadStateChangedEvent>().Subscribe( OnDownloadStateChanged, Prism.Events.ThreadOption.UIThread, keepSubscriberReferenceAlive: false, filter: e => e.FileId == FileId); EventAggregator.GetEvent <DownloadProgressChangedEvent>().Subscribe( OnDownloadProgressChanged, Prism.Events.ThreadOption.UIThread, keepSubscriberReferenceAlive: false, filter: e => e.FileId == FileId); }
public abstract Task UploadAsync(FileLocator @from, INetDiskFile to, Action <TransferItem> callback);
public abstract IDownloadingFile Download(INetDiskFile from, FileLocator to);
public abstract Task <bool> DeleteFileAsync(INetDiskFile file);
public DownloadTask(IUnityContainer container, INetDiskFile file, DownloadTaskToken token) : base(container) { }
public override Task <bool> DeleteFileAsync(INetDiskFile file) { throw new NotImplementedException(); }
public override Task UploadAsync(FileLocator @from, INetDiskFile to, Action <TransferItem> callback) { throw new NotImplementedException(); }
public override async Task <bool> DeleteFileAsync(INetDiskFile file) { var result = await WebApi.RemoveFileByPathAsync(new PathArgs { Path = file.Path }); return(true); }
public override IDownloadingFile Download(INetDiskFile @from, FileLocator to) { throw new NotImplementedException(); }
public static IDownloadingFile Create(INetDiskUser owner, INetDiskFile file, IDownloader downloader) { return(new DownloadingFile(owner, file, downloader)); }