Exemple #1
0
        //public static bool HasSidebarActions(this MasonryHtmlHelper helper)
        //{
        //  return GetSidebarActions(helper).Any();
        //}
        public static IEnumerable<HeaderActionGroup> GetHeaderActionGroups(this MasonryHtmlHelper helper)
        {
            var cache = new Dictionary<string, HeaderActionGroup>();

              var actions = GetHeaderActions().Where(v => !string.IsNullOrWhiteSpace(v.GroupName));

              foreach (var verb in actions)
              {
            HeaderActionGroup group;
            if (!cache.TryGetValue(verb.GroupName, out group))
            {
              group = new HeaderActionGroup { Name = verb.GroupName };
              cache[verb.GroupName] = group;
            }

            group.AddVerb(verb);
              }

              return cache.Values;
        }
Exemple #2
0
        //public static bool HasSidebarActions(this MasonryHtmlHelper helper)
        //{
        //  return GetSidebarActions(helper).Any();
        //}

        public static IEnumerable <HeaderActionGroup> GetHeaderActionGroups(this MasonryHtmlHelper helper)
        {
            var cache = new Dictionary <string, HeaderActionGroup>();

            var actions = GetHeaderActions().Where(v => !string.IsNullOrWhiteSpace(v.GroupName));

            foreach (var verb in actions)
            {
                HeaderActionGroup group;
                if (!cache.TryGetValue(verb.GroupName, out group))
                {
                    group = new HeaderActionGroup {
                        Name = verb.GroupName
                    };
                    cache[verb.GroupName] = group;
                }

                group.AddVerb(verb);
            }

            return(cache.Values);
        }