Exemplo n.º 1
0
 public Context(string baseFolder, IFileEmitter fileEmitter, IReadOnlyList <string> extensionsToRetrieveInOrderOfPrecendence, IReadOnlyList <string> sidecarExtensions)
 {
     this.BaseFolder  = baseFolder;
     this.FileEmitter = fileEmitter;
     this.ExtensionsToRetrieveInOrderOfPrecendence = extensionsToRetrieveInOrderOfPrecendence;
     this._cannotBeSoleExtensionMatch = BuildSidecarProcessor(sidecarExtensions);
 }
Exemplo n.º 2
0
        public static async Task <long> ScanFolderAsync(string baseFolder, IFileEmitter fileEmitter, IReadOnlyList <string> extensionsToRetrieveInOrderOfPrecendence, IReadOnlyList <string> sidecarFiles)
        {
            Context context = new(baseFolder : baseFolder,
                                  fileEmitter : fileEmitter,
                                  extensionsToRetrieveInOrderOfPrecendence : extensionsToRetrieveInOrderOfPrecendence,
                                  sidecarExtensions : sidecarFiles);

            await StartScanningAsync(context);

            long filesFound = await ProcessEntriesAsync(context);

            return(filesFound);
        }