Skip to content

Instantly share code, notes, and snippets.

@analogrelay
Created November 4, 2011 22:32
Show Gist options
  • Save analogrelay/1340667 to your computer and use it in GitHub Desktop.
Save analogrelay/1340667 to your computer and use it in GitHub Desktop.
int Count(Folder f) {
int count = 0;
foreach(Item i in f) {
if(i is File) {
count++;
} else {
count += Count((Folder)i);
}
}
return count;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment