public Folder ReadFolderTree() { ndb.Initialise(); using (var fs = ndb.GetReadStream()) { return(ReadFolderStructure(fs, new NID(EnidSpecial.NID_ROOT_FOLDER))); } }
public void ReadFolderTree() { ndb.Initialise(); using (var fs = ndb.GetReadStream()) { var root = ReadFolderStructure(fs, new NID(EnidSpecial.NID_ROOT_FOLDER)); foreach (var f in root.Folders) { // We may be called on a background thread, so we need to dispatch this to the UI thread Application.Current.Dispatcher.Invoke(new Action(() => { view.RootFolders.Add(f); })); } } }