36 lines
1.1 KiB
C#
36 lines
1.1 KiB
C#
using DTS.Common.Import.Interfaces;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Xml;
|
|
|
|
namespace DTS.Common.Import.XML
|
|
{
|
|
public class XMLParseMMECustomDirections : XMLParseBase
|
|
{
|
|
public XMLParseMMECustomDirections(XmlElement root, double importedVersion, Func<bool> isCancelled = null) : base(root, importedVersion, isCancelled)
|
|
{
|
|
}
|
|
|
|
public override void Parse(ref ImportObject importObject)
|
|
{
|
|
importObject.AddDirections(ParseCustomDirections(_root));
|
|
}
|
|
|
|
private IEnumerable<ISO.MMEDirections> ParseCustomDirections(XmlElement root)
|
|
{
|
|
List<ISO.MMEDirections> list = new List<ISO.MMEDirections>();
|
|
|
|
foreach (var child in root.ChildNodes)
|
|
{
|
|
if (IsCancelled()) { return list; }
|
|
if (child is XmlElement)
|
|
{
|
|
list.Add(ISO.MMEDirections.ReadXML(child as XmlElement));
|
|
}
|
|
}
|
|
return list;
|
|
}
|
|
}
|
|
}
|
|
|