I'm using the sharepoint client object model for a small application. When I try to get all folders and items from the "Shared Documents"-library, it doesn't return all folders and files.
Code:
private void SearchFolder(ClientContext context, SP.Folder folder, SP.List list, int niveau)
{
SP.FolderCollection collection = folder.Folders;
context.Load(collection);
context.ExecuteQuery();
//Search subfolders
foreach (SP.Folder tempFolder in collection)
{
string tempFolderNaam = tempFolder.Name;
SearchFolder(context, tempFolder, list, ++niveau);
}
//Search this folder
SearchFiles(context, folder, list, niveau);
}
I call this method with:
SearchFolder(context, list.RootFolder, list,0)
So it starts from the rootfolder and should get all (sub)files and (sub)folders
I've got 10 folders in the rootfolder and 1 subfolder in the first. It only returns 5 (4 are ok, one is "Forms"-folder)
Is there something i'm missing/did wrong? Or is this a bug?
Thanks in advance!