示例#1
0
 public List<FileInfo> GetFiles(HostInfo host, FolderInfo directory)
 {
     var directoryInfo = GetDirectoryInfo(host, directory);
     if (directoryInfo.Exists)
     {
         return directoryInfo.GetFiles(directory.Filter ?? "*").ToList();
     }
     return new List<FileInfo>();
 }
示例#2
0
 public List<DirectoryInfo> GetFolders(HostInfo host, FolderInfo directory)
 {
     if (!string.IsNullOrWhiteSpace(directory.SubfolderSearchPattern))
     {
         var directoryInfo = GetDirectoryInfo(host, directory);
         if (directoryInfo.Exists)
         {
             return directoryInfo.GetDirectories(directory.SubfolderSearchPattern).ToList();
         }
     }
     return new List<DirectoryInfo>();
 }
示例#3
0
 private string GetDirectoryPath(HostInfo host, FolderInfo directory)
 {
     return directory.Absolute ? directory.Path : GetUncDirectory(host.Unc, directory.Path);
 }
示例#4
0
 private DirectoryInfo GetDirectoryInfo(HostInfo host, FolderInfo directory)
 {
     string directoryPath = GetDirectoryPath(host, directory);
     return new DirectoryInfo(directoryPath);
 }
示例#5
0
 public bool Exists(HostInfo host, FolderInfo directory)
 {
     return GetDirectoryInfo(host, directory).Exists;
 }