public virtual IEnumerable<SiteMapNode> GetSiteMapNodes(ISiteMapDataSource dataSource) { var jsonDataSource = dataSource as ISiteMapJSONDataSource; if (jsonDataSource == null) throw new InvalidOperationException($"Invalid datasource type, expected {typeof(ISiteMapJSONDataSource)} but received {dataSource.GetType()}"); var json = jsonDataSource.GetSiteMapData(); if (json == null) throw new InvalidOperationException("File datasource is empty"); return LoadSiteMapFromJSON(json); }
public virtual IEnumerable <SiteMapNode> GetSiteMapNodes(ISiteMapDataSource dataSource) { var xmlDataSource = dataSource as ISiteMapXmlDataSource; if (xmlDataSource == null) { throw new InvalidOperationException($"Invalid datasource type, expected {typeof(ISiteMapXmlDataSource)} but received {dataSource.GetType()}"); } var xml = xmlDataSource.GetSiteMapData(); if (xml == null) { throw new InvalidOperationException("File datasource is empty"); } return(LoadSiteMapFromXml(xml)); }
public SiteMapBuilderSet(string builderSetName, ISiteMapDataSource siteMapDataSource, ICacheDetails cacheDetails) { this.siteMapDataSource = siteMapDataSource; this.builderSetName = builderSetName; this.cacheDetails = cacheDetails; }