33 lines
1.1 KiB
C#
33 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 XMLParseMMECustomMainLocations : XMLParseBase
|
|
{
|
|
public XMLParseMMECustomMainLocations(XmlElement root, double importedVersion, Func<bool> isCancelled = null) : base(root, importedVersion, isCancelled)
|
|
{
|
|
}
|
|
public override void Parse(ref ImportObject importObject)
|
|
{
|
|
importObject.AddCustomMainLocations(ParseCustomMainLocations(_root));
|
|
}
|
|
|
|
public IEnumerable<ISO.MMETransducerMainLocation> ParseCustomMainLocations(XmlElement root)
|
|
{
|
|
List<ISO.MMETransducerMainLocation> list = new List<ISO.MMETransducerMainLocation>();
|
|
foreach (var node in root.ChildNodes)
|
|
{
|
|
if (IsCancelled()) { return list; }
|
|
if (node is XmlElement)
|
|
{
|
|
list.Add(ISO.MMETransducerMainLocation.ReadXML(node as XmlElement));
|
|
}
|
|
}
|
|
return list;
|
|
}
|
|
|
|
}
|
|
} |