From d10b5e29bcef7335d38d4cbb590b60b7b171897b Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Thu, 14 May 2009 16:33:04 +0000
Subject: * refactor: break some of xml2 serialization out of sog
---
.../Scenes/Serialization/SceneObjectSerializer.cs | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/Serialization')
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index aa331d9..0ec1922 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -31,6 +31,7 @@ using System.Reflection;
using System.Xml;
using log4net;
using OpenMetaverse;
+using OpenSim.Framework;
using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.Framework.Scenes.Serialization
@@ -246,6 +247,24 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
writer.WriteEndElement(); // SceneObjectGroup
//m_log.DebugFormat("[SERIALIZER]: Finished serialization of SOG {0}, {1}ms", Name, System.Environment.TickCount - time);
+ }
+
+ ///
+ /// Serialize a scene object to the 'xml2' format.
+ ///
+ ///
+ ///
+ public static string ToXml2Format(ISceneObject sceneObject)
+ {
+ using (StringWriter sw = new StringWriter())
+ {
+ using (XmlTextWriter writer = new XmlTextWriter(sw))
+ {
+ sceneObject.ToXml2(writer);
+ }
+
+ return sw.ToString();
+ }
}
}
}
--
cgit v1.1