Is it possible to safely enumerate a ShellContainer in a background thread using Windows API CodePack?
I'm trying to enumerate ShellFolders (Desktop, My Computer, etc) and everything works great until I hit something that blocks the UI. In particular, 'Network' takes about 40 seconds to return a list of children.
I tried to run in a background Task, and it appears to work, but then some folders with known subfolders start to fail and return items with no name or parsing name. It seems that the interop has broken at that point and makes me think it is not thread safe.
new Task(() =>
{
// if this fails, the items will be ShellObjects
// but will have no parsingnames
var items = MyShellFolder.ToArray();
dispatcher.Invoke(() => MyChildren.AddRange(items));
}).Start();