/// <summary> /// Initializes a new instance of the <see cref="SiteMapNodeModel"/> class. /// </summary> /// <param name="node">The node.</param> /// <param name="sourceMetadata">The source metadata provided by the HtmlHelper.</param> /// <param name="maxDepth">The max depth.</param> /// <param name="drillDownToCurrent">Should the model exceed the maxDepth to reach the current node</param> /// <param name="startingNodeInChildLevel">Renders startingNode in child level if set to <c>true</c>.</param> public SiteMapNodeModel(ISiteMapNode node, IDictionary<string, object> sourceMetadata, int maxDepth, bool drillDownToCurrent, bool startingNodeInChildLevel, bool visibilityAffectsDescendants) { if (node == null) throw new ArgumentNullException("node"); if (sourceMetadata == null) throw new ArgumentNullException("sourceMetadata"); if (maxDepth < 0) throw new ArgumentOutOfRangeException("maxDepth"); this.node = node; this.maxDepth = maxDepth; this.startingNodeInChildLevel = startingNodeInChildLevel; this.drillDownToCurrent = drillDownToCurrent; this.SourceMetadata = sourceMetadata; Key = node.Key; Area = node.Area; Controller = node.Controller; Action = node.Action; Title = node.Title; Description = node.Description; TargetFrame = node.TargetFrame; ImageUrl = node.ImageUrl; Url = node.Url; CanonicalUrl = node.CanonicalUrl; MetaRobotsContent = node.GetMetaRobotsContentString(); IsCurrentNode = (node == node.SiteMap.CurrentNode); IsInCurrentPath = node.IsInCurrentPath(); IsRootNode = (node == node.SiteMap.RootNode); IsClickable = node.Clickable; VisibilityAffectsDescendants = visibilityAffectsDescendants; RouteValues = node.RouteValues; Attributes = node.Attributes; }
/// <summary> /// Initializes a new instance of the <see cref="SiteMapNodeModel"/> class. /// </summary> /// <param name="node">The node.</param> /// <param name="sourceMetadata">The source metadata provided by the HtmlHelper.</param> /// <param name="maxDepth">The max depth.</param> /// <param name="drillDownToCurrent">Should the model exceed the maxDepth to reach the current node</param> /// <param name="startingNodeInChildLevel">Renders startingNode in child level if set to <c>true</c>.</param> public SiteMapNodeModel(ISiteMapNode node, IDictionary <string, object> sourceMetadata, int maxDepth, bool drillDownToCurrent, bool startingNodeInChildLevel, bool visibilityAffectsDescendants) { if (node == null) { throw new ArgumentNullException("node"); } if (sourceMetadata == null) { throw new ArgumentNullException("sourceMetadata"); } if (maxDepth < 0) { throw new ArgumentOutOfRangeException("maxDepth"); } this.node = node; this.maxDepth = maxDepth; this.startingNodeInChildLevel = startingNodeInChildLevel; this.drillDownToCurrent = drillDownToCurrent; this.SourceMetadata = sourceMetadata; Key = node.Key; Area = node.Area; Controller = node.Controller; Action = node.Action; Site = node.Site; if (string.IsNullOrEmpty(node.Site)) { Site = node.RootNode.Site; } Title = node.Title; Description = node.Description; TargetFrame = node.TargetFrame; ImageUrl = node.ImageUrl; Url = node.Url; ResolvedUrl = node.ResolvedUrl; CanonicalUrl = node.CanonicalUrl; CanonicalUrlSeo = node.CanonicalUrlSeo; MetaRobotsContent = node.GetMetaRobotsContentString(); Include = node.Include; Exclude = node.Exclude; IsCurrentNode = (node.Equals(node.SiteMap.CurrentNode)); IsInCurrentPath = node.IsInCurrentPath(); IsRootNode = (node.Equals(node.SiteMap.RootNode)); IsClickable = node.Clickable; VisibilityAffectsDescendants = visibilityAffectsDescendants; RouteValues = node.RouteValues; Attributes = node.Attributes; Order = node.Order; }
/// <summary> /// Initializes a new instance of the <see cref="SiteMapNodeModel"/> class. /// </summary> /// <param name="node">The node.</param> /// <param name="sourceMetadata">The source metadata provided by the HtmlHelper.</param> /// <param name="maxDepth">The max depth.</param> /// <param name="drillDownToCurrent">Should the model exceed the maxDepth to reach the current node</param> /// <param name="startingNodeInChildLevel">Renders startingNode in child level if set to <c>true</c>.</param> public SiteMapNodeModel(ISiteMapNode node, IDictionary <string, object> sourceMetadata, int maxDepth, bool drillDownToCurrent, bool startingNodeInChildLevel) { if (node == null) { throw new ArgumentNullException("node"); } if (sourceMetadata == null) { throw new ArgumentNullException("sourceMetadata"); } if (maxDepth < 0) { throw new ArgumentOutOfRangeException("maxDepth"); } this.node = node; this.maxDepth = maxDepth; this.startingNodeInChildLevel = startingNodeInChildLevel; this.drillDownToCurrent = drillDownToCurrent; this.SourceMetadata = sourceMetadata; Area = node.Area; Controller = node.Controller; Action = node.Action; Title = node.Title; Description = node.Description; TargetFrame = node.TargetFrame; ImageUrl = node.ImageUrl; Url = node.Url; CanonicalUrl = node.CanonicalUrl; MetaRobotsContent = node.GetMetaRobotsContentString(); IsCurrentNode = (node == node.SiteMap.CurrentNode); IsInCurrentPath = node.IsInCurrentPath(); IsRootNode = (node == node.SiteMap.RootNode); IsClickable = node.Clickable; RouteValues = node.RouteValues; Attributes = node.Attributes; }