示例#1
0
 public DiffInfo(FileLocation remote, FileLocation local, string localDestination, string groupId)
 {
     Remote           = remote;
     Local            = local;
     LocalDestination = localDestination;
     GroupId          = groupId;
     if (Remote != null && Local == null)
     {
         Status = Status.Added;
     }
     else if (Remote != null && Local != null && (Remote.LastUpdateDateTime > Local.LastUpdateDateTime || Remote.Size != Local.Size))
     {
         Status = Status.Updated;
     }
     else if (Remote == null && Local != null)
     {
         Status = Status.Deleted;
     }
     else
     {
         Status = Status.Installed;
     }
 }
示例#2
0
        public Task DownloadFileAsync(FileLocation fileLocation, string downloadPath, Action <long> onProgress = null)
        {
            var progress = onProgress != null ? new FtpDownloadProgress(onProgress) : null;

            return(_client.DownloadFileAsync(downloadPath, fileLocation.Path, FtpLocalExists.Overwrite, FtpVerify.None, progress, CancellationToken.None));
        }