Konstantin Koch 8287c54432 Included the Visual Studio extension and made the necessary changes to make it run.
Replaced the old VS templates with ones that offer more flexiblity.
Started replacing the Content Project for the samples with our custom project type.
Inlcuded a basic not yet working AssimpImporter.
2015-04-08 14:50:03 +02:00

31 lines
1004 B
C#

using System;
using System.Collections.Generic;
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;
}
public static IEnumerable<XmlNode> GetAsEnumerable(this XmlNodeList list)
{
for (int i = 0; i < list.Count; i++)
yield return list[i];
}
}
}