public DownloadFileOperation(SMBItem smbItem, string dstPath)
 {
     if (smbItem.IsDirectory)
     {
         throw new ArgumentException("Must not be a directory", nameof(smbItem));
     }
     if (!Path.IsPathFullyQualified(dstPath))
     {
         throw new ArgumentException("Must be a fully qualified path", nameof(dstPath));
     }
     SMBItem = smbItem;
     DstPath = dstPath;
 }
Ejemplo n.º 2
0
        private void CreateOperationsForDirectory(SMBItem item, string dstPath)
        {
            AddOperation(new CreateDirectoryOperation(dstPath));

            foreach (var child in smbFileShare.RetrieveItems(item))
            {
                if (item.IsDirectory)
                {
                    CreateOperationsForDirectory(item, Path.Combine(dstPath, item.Name));
                }
                else
                {
                    AddOperation(new CopyFileOperation(child, Path.Combine(dstPath, item.Name)));
                }
            }
        }
Ejemplo n.º 3
0
        public void CreateOperationsForDirectory(SMBItem smbItem, string dstPath)
        {
            AddOperation(new CreateDownloadDirectoryOperation(dstPath));

            foreach (var item in smbFileShare.RetrieveItems(smbItem))
            {
                if (item.IsDirectory)
                {
                    CreateOperationsForDirectory(item, Path.Combine(dstPath, item.Name));
                }
                else
                {
                    AddOperation(new DownloadFileOperation(item, Path.Combine(dstPath, item.Name)));
                }
            }
        }
Ejemplo n.º 4
0
 public CopyFileOperation(SMBItem item, string dstPath)
 {
     Item    = item;
     DstPath = dstPath;
 }
Ejemplo n.º 5
0
 public List <SMBItem> RetrieveItems(SMBItem smbItem)
 {
     return(RetrieveItems(smbItem.Path));
 }