/// <summary> /// Recursively, in depth-first order, add all the folders we've received (stored /// in a dictionary indexed by parent ID) into the tree that describes user folder /// heirarchy /// Any folder that is resolved into the tree is also added to resolvedFolderDictionary, /// indexed by folder ID. /// </summary> /// <param name="parentId"> /// A <see cref="UUID"/> /// </param> private void ResolveReceivedFolders(InventoryFolderImpl parentFolder, IDictionary <UUID, IList <InventoryFolderImpl> > receivedFolderDictionary, IDictionary <UUID, InventoryFolderImpl> resolvedFolderDictionary) { if (receivedFolderDictionary.ContainsKey(parentFolder.ID)) { List <InventoryFolderImpl> resolvedFolders = new List <InventoryFolderImpl>(); // Folders we've resolved with this invocation foreach (InventoryFolderImpl folder in receivedFolderDictionary[parentFolder.ID]) { if (parentFolder.ContainsChildFolder(folder.ID)) { m_log.WarnFormat( "[INVENTORY CACHE]: Received folder {0} {1} from inventory service which has already been received", folder.Name, folder.ID); } else { if (resolvedFolderDictionary.ContainsKey(folder.ID)) { m_log.WarnFormat( "[INVENTORY CACHE]: Received folder {0} {1} from inventory service has already been received but with different parent", folder.Name, folder.ID); } else { resolvedFolders.Add(folder); resolvedFolderDictionary[folder.ID] = folder; parentFolder.AddChildFolder(folder); } } } // foreach (folder in pendingCategorizationFolders[parentFolder.ID]) receivedFolderDictionary.Remove(parentFolder.ID); foreach (InventoryFolderImpl folder in resolvedFolders) { ResolveReceivedFolders(folder, receivedFolderDictionary, resolvedFolderDictionary); } } // if (receivedFolderDictionary.ContainsKey(parentFolder.ID)) }
/// <summary> /// Recursively, in depth-first order, add all the folders we've received (stored /// in a dictionary indexed by parent ID) into the tree that describes user folder /// heirarchy /// Any folder that is resolved into the tree is also added to resolvedFolderDictionary, /// indexed by folder ID. /// </summary> /// <param name="parentId"> /// A <see cref="UUID"/> /// </param> private void ResolveReceivedFolders(InventoryFolderImpl parentFolder, IDictionary<UUID, IList<InventoryFolderImpl>> receivedFolderDictionary, IDictionary<UUID, InventoryFolderImpl> resolvedFolderDictionary) { if (receivedFolderDictionary.ContainsKey(parentFolder.ID)) { List<InventoryFolderImpl> resolvedFolders = new List<InventoryFolderImpl>(); // Folders we've resolved with this invocation foreach (InventoryFolderImpl folder in receivedFolderDictionary[parentFolder.ID]) { if (parentFolder.ContainsChildFolder(folder.ID)) { m_log.WarnFormat( "[INVENTORY CACHE]: Received folder {0} {1} from inventory service which has already been received", folder.Name, folder.ID); } else { if (resolvedFolderDictionary.ContainsKey(folder.ID)) { m_log.WarnFormat( "[INVENTORY CACHE]: Received folder {0} {1} from inventory service has already been received but with different parent", folder.Name, folder.ID); } else { resolvedFolders.Add(folder); resolvedFolderDictionary[folder.ID] = folder; parentFolder.AddChildFolder(folder); } } } // foreach (folder in pendingCategorizationFolders[parentFolder.ID]) receivedFolderDictionary.Remove(parentFolder.ID); foreach (InventoryFolderImpl folder in resolvedFolders) ResolveReceivedFolders(folder, receivedFolderDictionary, resolvedFolderDictionary); } // if (receivedFolderDictionary.ContainsKey(parentFolder.ID)) }