mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-01-11 19:44:55 +00:00
41 lines
674 B
C#
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);
|
|
}
|
|
}
|
|
}
|