Files
ICD.Common.Utils/ICD.Common/Utils/Xml/IcdXmlDocument.cs
2017-06-21 22:41:54 -04:00

41 lines
674 B
C#

#if SIMPLSHARP
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronXml;
#else
using System.Xml;
#endif
namespace ICD.Common.Utils.Xml
{
public sealed class IcdXmlDocument
{
private readonly XmlDocument m_Document;
/// <summary>
/// Constructor.
/// </summary>
public IcdXmlDocument()
{
m_Document = new XmlDocument();
}
public void LoadXml(string xml)
{
try
{
m_Document.LoadXml(xml);
}
catch (XmlException e)
{
throw new IcdXmlException(e.Message, e, e.LineNumber, e.LinePosition);
}
}
public void WriteContentTo(IcdXmlTextWriter writer)
{
m_Document.WriteContentTo(writer.WrappedWriter);
}
}
}