IXmlDataImporterImport Method |
Namespace: PDTec.IceNet.Core.Xml
void Import( XmlReader pXmlReader, IFolder pTargetFolder )
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); }