SND\eagleeyestudios_cp fa180a58b8 Content Pipeline:
- started implementing XmlImporter
2015-03-15 01:11:14 +01:00

24 lines
773 B
C#

using System;
using System.Xml;
namespace ANX.Framework.Content.Pipeline.Serialization
{
public static class XmlReaderExtensions
{
/// <summary>
/// Checks if the current document contains the given element.
/// </summary>
/// <param name="xmlReader"></param>
/// <param name="name">Name of the element</param>
/// <returns></returns>
public static bool CheckForElement(this XmlReader xmlReader, string name)
{
if (string.IsNullOrEmpty(name))
{
throw new ArgumentException("Element name can not be null!");
}
return xmlReader.MoveToContent() == XmlNodeType.Element && xmlReader.Name == name;
}
}
}