Beispiel #1
0
        public async Task <string> GetScriptAsync()
        {
            var userMenus = await userNavigationManager.GetMenusAsync(StudioXSession.ToUserIdentifier());

            var sb = new StringBuilder();

            sb.AppendLine("(function() {");

            sb.AppendLine("    studiox.nav = {};");
            sb.AppendLine("    studiox.nav.menus = {");

            for (int i = 0; i < userMenus.Count; i++)
            {
                AppendMenu(sb, userMenus[i]);
                if (userMenus.Count - 1 > i)
                {
                    sb.Append(" , ");
                }
            }

            sb.AppendLine("    };");

            sb.AppendLine("})();");

            return(sb.ToString());
        }
Beispiel #2
0
        private async Task <UserNavConfigDto> GetUserNavConfig()
        {
            var userMenus = await _userNavigationManager.GetMenusAsync(_Session.ToUserIdentifier());

            return(new UserNavConfigDto
            {
                Menus = userMenus.ToDictionary(userMenu => userMenu.Name, userMenu => userMenu)
            });
        }
        public PartialViewResult SocialMenu()
        {
            var model = new SocialMenuViewModel
            {
                SocialMenu = AsyncHelper.RunSync(() => _userNavigationManager.GetMenusAsync(AbpSession.ToUserIdentifier())),
            };

            return(PartialView("_SocialMenu", model));
        }