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