Skip to content

Instantly share code, notes, and snippets.

@JeremyKuhne
Created March 8, 2018 05:42
Show Gist options
  • Save JeremyKuhne/316298513619f8fec8be53c3bfb1a21a to your computer and use it in GitHub Desktop.
Save JeremyKuhne/316298513619f8fec8be53c3bfb1a21a to your computer and use it in GitHub Desktop.
FileSystemEnumerable
namespace System.IO.Enumeration
{
public class FileSystemEnumerable<TResult> : Collections.Generic.IEnumerable<TResult>
{
public FileSystemEnumerable(string directory, FindTransform transform, EnumerationOptions options = null);
// True to recurse into the given directory
public FindPredicate ShouldRecursePredicate { get; set; }
// True to include the given item in the results (through the given transform)
public FindPredicate ShouldIncludePredicate { get; set; }
public IEnumerator<TResult> GetEnumerator();
IEnumerator IEnumerable.GetEnumerator();
public delegate bool FindPredicate(ref FileSystemEntry entry);
public delegate TResult FindTransform(ref FileSystemEntry entry);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment