From 6a8d8f54e88a21e6cfd78dc7981cdeec2f18094d Mon Sep 17 00:00:00 2001 From: Tleiades Hax Date: Tue, 30 Oct 2007 22:42:34 +0000 Subject: Step one on the long march towards grid based inventory. Introduction of an InevntoryServer --- OpenSim/Framework/General/InventoryItemBase.cs | 30 +++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/General/InventoryItemBase.cs') diff --git a/OpenSim/Framework/General/InventoryItemBase.cs b/OpenSim/Framework/General/InventoryItemBase.cs index 45700ae..f782913 100644 --- a/OpenSim/Framework/General/InventoryItemBase.cs +++ b/OpenSim/Framework/General/InventoryItemBase.cs @@ -25,6 +25,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ +using System; +using System.Xml.Serialization; +using System.Collections; using System.Collections.Generic; using libsecondlife; @@ -242,4 +245,29 @@ namespace OpenSim.Framework /// The id of the folder void deleteInventoryFolder(LLUUID folder); } -} \ No newline at end of file + + /* + * .Net has some issues, serializing a dictionary, so we cannot reuse the InventoryFolder + * class defined in Communications.Framework.Communications.Caches. So we serialize/deserialize + * into this simpler class, and then use that. + */ + [XmlRoot(ElementName = "inventory", IsNullable = true)] + public class SerializableInventory + { + [XmlRoot(ElementName = "folder", IsNullable = true)] + public class SerializableFolder : InventoryFolderBase + { + [XmlArray(ElementName = "folders", IsNullable = true)] + [XmlArrayItem(ElementName = "folder", IsNullable = true, Type = typeof(SerializableFolder))] + public ArrayList SubFolders; + + [XmlArray(ElementName = "items", IsNullable = true)] + [XmlArrayItem(ElementName = "item", IsNullable = true, Type = typeof(InventoryItemBase))] + public ArrayList Items; + } + + [XmlElement(ElementName = "folder", IsNullable = true)] + public SerializableFolder root; + } + +} -- cgit v1.1