Files
libremetaverse/libsecondlife/examples/TestClient/Commands/Inventory/InventoryCommand.cs
John Hurliman 3013742668 * Increased SIMULATOR_TIMEOUT to 30 seconds
* Converted all timers to System.Threading timers to fix problems running in services and the CF
* UDPBase now uses our own ReaderWriterLock that is more efficient, and CF compatible
* Login uses a hand-created LoginProxy object instead of dynamically building the class with reflection .Emit()
* Replaced ParameterizedThreadStart calls with class-wide variables for CF compat.
* Removed transfer timeout code (irrelevant now that uploads go through CAPS)
* Added several new Helpers methods to wrap desktop and CF conditional code
* Replaced Monitor calls with AutoResetEvent in BlockingQueue
* InventoryNodeDictionary uses generics now
* Removed final lingering piece of XML serialization
* Added CookComputing.XmlRpc.CF.dll for the CF

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1479 52acb1d6-8a22-11de-b505-999d5b087335
2007-11-06 09:26:10 +00:00

61 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading;
using System.Xml;
using System.Xml.Serialization;
using libsecondlife;
using libsecondlife.Packets;
namespace libsecondlife.TestClient
{
public class InventoryCommand : Command
{
private Inventory Inventory;
private InventoryManager Manager;
public InventoryCommand(TestClient testClient)
{
Name = "i";
Description = "Prints out inventory.";
}
public override string Execute(string[] args, LLUUID fromAgentID)
{
Manager = Client.Inventory;
Inventory = Manager.Store;
StringBuilder result = new StringBuilder();
//Client.Inventory.RequestFolderContents(Client.Inventory.Store.RootFolder.UUID, Client.Self.AgentID,
// true, true, InventorySortOrder.ByName);
//PrintFolder(Inventory.RootNode, result, 0);
//return result.ToString();
//FIXME:
return "This function needs a blocking InventoryManager.FolderContents() to work";
}
void PrintFolder(InventoryNode f, StringBuilder result, int indent)
{
foreach ( InventoryNode i in f.Nodes.Values )
{
result.Append(i.Data.Name + "\n");
if ( i.Nodes.Count > 0 )
PrintFolder(i, result, indent + 1);
}
}
//void Indent(StringBuilder output, int indenting)
//{
// for (int count = 0; count < indenting; count++)
// {
// output.Append(" ");
// }
//}
}
}