Using the following code:
using (SPSite site = new SPSite("http://localhost/"))
{
using (SPWeb web = site.OpenWeb())
{
foreach (SPList list in web.Lists)
{
if (list.OnQuickLaunch)
{
Console.WriteLine(list.Title);
foreach (SPListItem item in list.Folders)
{
Console.WriteLine("- " + item.Title);
}
}
}
}
}
and the output:
... various lists ...
Shared Documents
- Minutes
- Second Level
I get all the folders back as a flat list - no real indication of the nesting that can happen as a folder is created as a child of another folder. Spelunking around with Visual Studio I can see a few interesting properties that might give me some clues (like item.Url and counting / characters or item.Folder.ParentFolder compared against something?), but there has got to be a simpler way.
Thanks!