Files
libremetaverse/SLProxy/XmlRpcCS/XmlRpcResponseSerializer.cs
John Hurliman 77a9c8bd23 * XmlRpcCS has been replaced with custom XML handling, all login code has been moved to Login.cs
* XmlRpcCS moved to SLProxy folder, since SLProxy still relies on it
* Client.Network.LoginError is now obsolete, replaced by Client.Network.LoginErrorKey and Client.Network.LoginMessage
* Client.Self now has StartLocation and AgentAccess strings after a successful Login
* Removed the null LLUUID check in _Packets_.cs since LLUUID will be a struct soon
* Fixed directories in mapgen.bat
* AgentThrottle class lives in AgentThrottle.cs now

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1097 52acb1d6-8a22-11de-b505-999d5b087335
2007-04-02 04:37:15 +00:00

58 lines
1.8 KiB
C#

namespace Nwc.XmlRpc
{
using System;
using System.Collections;
using System.Xml;
/// <summary>Class responsible for serializing an XML-RPC response.</summary>
/// <remarks>This class handles the response envelope, depending on XmlRpcSerializer
/// to serialize the payload.</remarks>
/// <seealso cref="XmlRpcSerializer"/>
public class XmlRpcResponseSerializer : XmlRpcSerializer
{
static private XmlRpcResponseSerializer _singleton;
/// <summary>A static singleton instance of this deserializer.</summary>
static public XmlRpcResponseSerializer Singleton
{
get
{
if (_singleton == null)
_singleton = new XmlRpcResponseSerializer();
return _singleton;
}
}
/// <summary>Serialize the <c>XmlRpcResponse</c> to the output stream.</summary>
/// <param name="output">An <c>XmlTextWriter</c> stream to write data to.</param>
/// <param name="obj">An <c>Object</c> to serialize.</param>
/// <seealso cref="XmlRpcResponse"/>
override public void Serialize(XmlTextWriter output, Object obj)
{
XmlRpcResponse response = (XmlRpcResponse)obj;
output.WriteStartDocument();
output.WriteStartElement(METHOD_RESPONSE);
if (response.IsFault)
output.WriteStartElement(FAULT);
else
{
output.WriteStartElement(PARAMS);
output.WriteStartElement(PARAM);
}
output.WriteStartElement(VALUE);
SerializeObject(output, response.Value);
output.WriteEndElement();
output.WriteEndElement();
if (!response.IsFault)
output.WriteEndElement();
output.WriteEndElement();
}
}
}