예제 #1
0
        private IEnumerable <FileLink> ReadFileLinksCore(FolderResource subfolder, bool recursive = false)
        {
            var folderPath = Link.Then(subfolder).ToString();
            var pattern    = "*.*";
            var option     = recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly;

            return(Directory.GetFiles(folderPath, pattern, option).Select(file => FileLink.From(file)));
        }
예제 #2
0
        public static IOLink From(string value, bool strict = true)
        {
            var link = FileLink.From(value, strict: false) ?? FolderLink.From(value, strict: false) as IOLink;

            ExpectNot(strict && link == null, "Value is not an I/O link");

            return(link);
        }
예제 #3
0
 public static bool TryFrom(string value, out IOLink link, bool extensionOptional = false)
 {
     if (FileLink.TryFrom(value, out var file, extensionOptional))
     {
         link = file;
     }
예제 #4
0
 public FileLink Then(FileName file) =>
 FileLink.From(this, FileResource.From(file));
예제 #5
0
 public FileLink Then(FileResource file) =>
 FileLink.From(this, file);
예제 #6
0
 public FileLink Then(FileName file)
 {
     return(FileLink.From(this, FileResource.From(file)));
 }
예제 #7
0
 public FileLink Then(FileResource file)
 {
     return(FileLink.From(this, file));
 }