From b77bf180799e181836e0cc87a62003c36fcbd740 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Fri, 12 Oct 2007 19:31:37 +0000 Subject: * Just extracted a standard ToXml() on SceneObjectGroup --- OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 17 +++++++++++++---- OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 3 ++- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 45db5f7..1603c52 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -311,8 +311,19 @@ namespace OpenSim.Region.Environment.Scenes public string ToXmlString() { - StringWriter sw = new StringWriter(); - XmlTextWriter writer = new XmlTextWriter(sw); + using (StringWriter sw = new StringWriter()) + { + using (XmlTextWriter writer = new XmlTextWriter(sw)) + { + ToXml(writer); + } + + return sw.ToString(); + } + } + + public void ToXml(XmlTextWriter writer) + { writer.WriteStartElement(String.Empty, "SceneObjectGroup", String.Empty); writer.WriteStartElement(String.Empty, "RootPart", String.Empty); m_rootPart.ToXml(writer); @@ -329,8 +340,6 @@ namespace OpenSim.Region.Environment.Scenes } writer.WriteEndElement(); writer.WriteEndElement(); - writer.Close(); - return sw.ToString(); } #region Copying diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 22408d3..1004e62 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -22,7 +22,8 @@ namespace OpenSim.Region.Environment.Scenes private string m_inventoryFileName = ""; private LLUUID m_folderID = LLUUID.Zero; - [XmlIgnore] public PhysicsActor PhysActor = null; + [XmlIgnore] + public PhysicsActor PhysActor = null; protected Dictionary TaskInventory = new Dictionary(); -- cgit v1.1