Beispiel #1
0
        public static IStream <TOut> CrossApplyFolderFiles <TIn, TOut>(this IStream <TIn> stream, string name, Func <TIn, string> getFolderPath, Func <TIn, string> getSearchPattern, Func <LocalFilesValue, TIn, TOut> selector, bool recursive = false, bool noParallelisation = false)
        {
            var valuesProvider = new LocalFilesValuesProvider();

            return(stream.CrossApply(name, (inputValue, push) =>
            {
                var args = new LocalFilesValuesProviderArgs
                {
                    RootFolder = getFolderPath(inputValue),
                    SearchPattern = getSearchPattern(inputValue),
                    Recursive = recursive
                };
                valuesProvider.PushValues(push, args);
            }, i => i, selector, noParallelisation));
        }
Beispiel #2
0
        public static IStream <LocalFilesValue> CrossApplyFolderFiles(this IStream <string> stream, string name, string pattern = "*", bool recursive = false, bool noParallelisation = false)
        {
            var valuesProvider = new LocalFilesValuesProvider();

            return(stream.CrossApply <string, LocalFilesValue>(name, (inputValue, push) =>
            {
                var args = new LocalFilesValuesProviderArgs
                {
                    RootFolder = inputValue,
                    SearchPattern = pattern,
                    Recursive = recursive
                };
                valuesProvider.PushValues(push, args);
            }, noParallelisation));
        }