Created
November 4, 2011 22:32
-
-
Save analogrelay/1340667 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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