public void Node_Null_Attrib_clone() { SiteMapNode node = new SiteMapNode(new DummyProvider(), "", "", "", null, null, null, null, null); SiteMapNode copy = node.Clone(); Assert.IsNotNull(copy, "Node not created"); Assert.AreEqual(copy, node, "Cloning failed"); }
protected override HierarchicalDataSourceView GetHierarchicalView(string viewPath) { SiteMapNode root = Provider.RootNode; SiteMapNode newRoot = root.Clone(); newRoot.ChildNodes = new SiteMapNodeCollection(); SiteMapNodeCollection collection = new SiteMapNodeCollection(); collection.Add(newRoot); collection.AddRange(root.ChildNodes); return(new SiteMapHierarchicalDataSourceView(collection)); }
public override bool IsAccessibleToUser(HttpContext context, SiteMapNode node) { string relativePathToAppRoot = EcpUrl.GetRelativePathToAppRoot(node.Url); if (relativePathToAppRoot != null) { string rewriteUrl = EacFlightProvider.Instance.GetRewriteUrl(relativePathToAppRoot); if (!EacFlightProvider.Instance.IsUrlEnabled(rewriteUrl ?? relativePathToAppRoot)) { return(false); } if (rewriteUrl != null) { node = node.Clone(); node.Url = EcpUrl.ReplaceRelativePath(node.Url, rewriteUrl, true); } } return(base.IsAccessibleToUser(context, node)); }
public override SiteMapNode FindSiteMapNode(string rawUrl) { SiteMapNode node = base.FindSiteMapNode(rawUrl); if (node != null) { var page = HttpContext.Current.Handler as Page; if (page != null) { page.Title = node.Title; } var newNode = node.Clone(true); newNode.Url = rawUrl; return(newNode); } else { return(null); } }