mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-17 21:54:58 +00:00
Created S# .sln and moved project to src folder
This commit is contained in:
40
ICD.Common/Utils/Xml/IcdXmlDocument.cs
Normal file
40
ICD.Common/Utils/Xml/IcdXmlDocument.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
#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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user