/// <summary> /// Creates a page-path component. /// </summary> public PagePath(PagePathCurrentPageBehavior currentPageBehavior = PagePathCurrentPageBehavior.IncludeCurrentPage) { if (currentPageBehavior != PagePathCurrentPageBehavior.ExcludeCurrentPage) { pageName = new PageName( excludePageNameIfEntitySetupExists: currentPageBehavior == PagePathCurrentPageBehavior.IncludeCurrentPageAndExcludePageNameIfEntitySetupExists); } var pagePath = PageBase.Current.ResourcePath; var components = new List <FlowComponent>(); foreach (var resource in pagePath.Take(pagePath.Count - 1)) { components.Add(new EwfHyperlink(resource, new StandardHyperlinkStyle(resource.ResourceFullName))); components.AddRange(ResourceBase.ResourcePathSeparator.ToComponents()); } if (pageName != null) { components.Add(pageName); } else if (components.Any()) { components.RemoveAt(components.Count - 1); } children = new GenericFlowContainer(components, classes: elementClass).ToCollection(); }
/// <summary> /// Creates a page path control. /// </summary> public PagePath( PagePathCurrentPageBehavior currentPageBehavior = PagePathCurrentPageBehavior.IncludeCurrentPage ) { if( currentPageBehavior != PagePathCurrentPageBehavior.ExcludeCurrentPage ) { pageName = new PageName { ExcludesPageNameIfEntitySetupExists = currentPageBehavior == PagePathCurrentPageBehavior.IncludeCurrentPageAndExcludePageNameIfEntitySetupExists }; } }
/// <summary> /// Creates a page path control. /// </summary> public PagePath(PagePathCurrentPageBehavior currentPageBehavior = PagePathCurrentPageBehavior.IncludeCurrentPage) { if (currentPageBehavior != PagePathCurrentPageBehavior.ExcludeCurrentPage) { pageName = new PageName { ExcludesPageNameIfEntitySetupExists = currentPageBehavior == PagePathCurrentPageBehavior.IncludeCurrentPageAndExcludePageNameIfEntitySetupExists }; } }