public virtual IImportRecord Read(XPathNavigator navigator) { if (navigator == null) { throw new ArgumentNullException("navigator"); } ReadingJournal journal = new ReadingJournal(); foreach (XPathNavigator itemElement in EnumerateChildren(navigator)) { try { ContentItem item = ReadSingleItem(itemElement, journal); journal.Report(item); } catch (DefinitionNotFoundException ex) { journal.Error(ex); if (!_ignoreMissingTypes) { throw; } } } return(journal); }
public void Read(XPathNavigator navigator, ContentItem item, ReadingJournal journal) { IDictionary<string, IAttachmentHandler> attachments = _explorer.Map<IAttachmentHandler>(item.GetContentType()); foreach(XPathNavigator attachmentElement in EnumerateChildren(navigator)) { string name = attachmentElement.GetAttribute("name", string.Empty); if(attachments.ContainsKey(name)) { XPathNavigator attachmentContents = navigator.CreateNavigator(); attachmentContents.MoveToFirstChild(); Attachment a = attachments[name].Read(attachmentContents, item); if(a != null) journal.Report(a); } } }
public void Read(XPathNavigator navigator, ContentItem item, ReadingJournal journal) { IDictionary<string, IAttachmentHandler> attachments = explorer.Map<IAttachmentHandler>(item.GetContentType()); foreach(XPathNavigator attachmentElement in EnumerateChildren(navigator)) { string name = attachmentElement.GetAttribute("name", string.Empty); if(attachments.ContainsKey(name)) { XPathNavigator attachmentContents = navigator.CreateNavigator(); attachmentContents.MoveToFirstChild(); Attachment a = attachments[name].Read(attachmentContents, item); if(a != null) journal.Report(a); } } }
public virtual IImportRecord Read(XPathNavigator navigator) { if (navigator == null) throw new ArgumentNullException("navigator"); ReadingJournal journal = new ReadingJournal(); foreach (XPathNavigator itemElement in EnumerateChildren(navigator)) { try { ContentItem item = ReadSingleItem(itemElement, journal); journal.Report(item); } catch (DefinitionNotFoundException ex) { journal.Error(ex); if (!ignoreMissingTypes) throw; } } return journal; }
private static IImportRecord CreateRecord(ContentItem item) { ReadingJournal rj = new ReadingJournal(); rj.Report(item); return rj; }