示例#1
0
        private void SetLanguageItemsRepeater()
        {
            var languageLinks = HeaderFolder.GetLanguageLinks();

            if (languageLinks.Any())
            {
                rptLanguage.DataSource = languageLinks;
                rptLanguage.DataBind();
            }
        }
示例#2
0
        private void GetUtilityNavigationItems()
        {
            var utilityNavigationFolder = HeaderFolder.GetUtilityNavigationFolder();

            if (utilityNavigationFolder != null)
            {
                var results = utilityNavigationFolder.GetNavigationLinkItems();

                if (results.Any())
                {
                    // NOTE: Signup/Signout link is contained in separate markup from utility nav

                    // Utility nav
                    var utility = results.Where(i => i.IsOfType(NavigationLinkItem.TemplateId));
                    if (utility.Any())
                    {
                        rptNavUtility.DataSource = utility;
                        rptNavUtility.DataBind();
                    }

                    // Sign-in/out
                    var authenticated = results.Where(i => i.IsOfType(AuthenticationNavigationLinkItem.TemplateId))
                                        .Select(i => new AuthenticationNavigationLinkItem(i))
                                        .FirstOrDefault();

                    if (authenticated != null)
                    {
                        scLinkSignIn.Visible = !IsUserLoggedIn;
                        lbSignout.Visible    = IsUserLoggedIn;

                        scLinkSignIn.Item = authenticated;
                        lbSignout.Text    = authenticated.LogoutText.Rendered;
                    }
                }
            }
        }