public void AddSubNavPoint(IBaseXHTMLFile subcontent, string name) { var newPoint = new NavPoint { Content = subcontent.PathInEPUB.GetRelativePath(DefaultInternalPaths.TOCFilePath, subcontent.FlatStructure), Name = name }; var parentPoint = _navMap.Find(x => (x.Content == subcontent.NavigationParent.PathInEPUB.GetRelativePath(DefaultInternalPaths.TOCFilePath, subcontent.NavigationParent.FlatStructure))); if (parentPoint != null) { parentPoint.SubPoints.Add(newPoint); } else { foreach (var element in _navMap) { parentPoint = element.AllContent().Find(x => (x.Content == subcontent.NavigationParent.PathInEPUB.GetRelativePath(DefaultInternalPaths.TOCFilePath, subcontent.NavigationParent.FlatStructure))); if (parentPoint != null) { parentPoint.SubPoints.Add(newPoint); return; } } throw new Exception("no such point to add sub point"); } }
public void AddNavPoint(IBaseXHTMLFile content, string name) { var bookPoint = new NavPoint { Content = content.PathInEPUB.GetRelativePath(DefaultInternalPaths.TOCFilePath, content.FlatStructure), Name = name }; _navMap.Add(bookPoint); }