Click or drag to resize

IXmlDataImporterImport Method

Imports data from an XML reader into a folder.

Namespace:  PDTec.IceNet.Core.Xml
Assembly:  PDTec.IceNet.Core (in PDTec.IceNet.Core.dll) Version: 7.2.0.0 (7.2.7583.15464)
Syntax
C#
void Import(
	XmlReader pXmlReader,
	IFolder pTargetFolder
)

Parameters

pXmlReader
Type: System.XmlXmlReader
The XML reader. The reader must be positioned on the Data element.
pTargetFolder
Type: PDTec.IceNet.Core.ModelIFolder
Examples
XmlReader pXmlReader = XmlReader.Create(pXmlStream);

if (!pXmlReader.IsStartElement())
{
    throw new ApplicationException("XML error: no start tag found");
}

if (!pXmlReader.ReadToDescendant("Data"))
{
    throw new ApplicationException("XML error: Data tag missing");
}

IXmlDataImporter pImporter = XmlFactory.CreateDataImporter(Repository);

pImporter.Import(pXmlReader, m_pFolder);

foreach (KeyValuePair<string, string> pKey in pImporter.FolderKeys)
{
    Repository.GetFolder(pKey.Value).AddKey(pKey.Key);
}

foreach (KeyValuePair<string, string> pKey in pImporter.ObjectKeys)
{
    Repository.GetObject(pKey.Value).AddKey(pKey.Key);
}
See Also