Applying patches from [LIBOMV-288] to completely redo the InventoryManager system, hopefully for great justice

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@2021 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2008-07-29 21:36:53 +00:00
parent 71837bfcf6
commit bfa6f6ca3f
23 changed files with 2603 additions and 1659 deletions

View File

@@ -25,27 +25,39 @@ namespace OpenMetaverse.TestClient
public override string Execute(string[] args, UUID fromAgentID)
{
Manager = Client.Inventory;
Inventory = Manager.Store;
Inventory = Client.InventoryStore;
StringBuilder result = new StringBuilder();
InventoryFolder rootFolder = Inventory.RootFolder;
PrintFolder(rootFolder, result, 0);
return result.ToString();
}
void PrintFolder(InventoryFolder f, StringBuilder result, int indent)
void PrintFolder(InventoryFolder folder, StringBuilder result, int indent)
{
foreach (InventoryBase i in Manager.FolderContents(f.UUID, Client.Self.AgentID, true, true, InventorySortOrder.ByName, 3000))
folder.DownloadContents(TimeSpan.FromSeconds(10));
foreach (InventoryBase b in folder)
{
result.AppendFormat("{0}{1} ({2})\n", new String(' ', indent * 2), i.Name, i.UUID);
if (i is InventoryFolder)
if (b is InventoryFolder)
{
InventoryFolder folder = (InventoryFolder)i;
PrintFolder(folder, result, indent + 1);
result.Append(Print(b as InventoryFolder, indent));
PrintFolder(b as InventoryFolder, result, indent + 1);
}
else if (b is InventoryItem)
{
result.Append(Print(b as InventoryItem, indent));
}
}
}
string Print(InventoryItem item, int indent)
{
return string.Format("{0}{1} ({2})\n", new String(' ', indent * 2), item.Data.Name, item.UUID);
}
string Print(InventoryFolder folder, int indent)
{
return string.Format("{0}{1} ({2})\n", new String(' ', indent * 2), folder.Data.Name, folder.UUID);
}
}
}
}