Example #1
0
        private static List <ApplicationGroup> GetGroupsTree(string lang)
        {
            var lgroups    = PageLangManager.GetGroupsContent(lang);
            var groupIcons = PageLangManager.GroupIcons;

            var groups = new List <ApplicationGroup>();

            foreach (var lgroup in lgroups)
            {
                if (lgroup.Key.Length != 1)
                {
                    continue;
                }
                var ico = string.Empty;
                foreach (var groupIcon in groupIcons.Where(groupIcon => lgroup.Key == groupIcon.Key))
                {
                    ico = groupIcon.Value.ToString();
                }
                groups.Add(new ApplicationGroup(lgroup.Key, lgroup.Value.ToString(), ico));
            }

            foreach (var i4 in lgroups)
            {
                if (!Regex.Match(i4.Key, @"\w{1}\d{1,3}").Success)
                {
                    continue;
                }
                var groupName = Regex.Match(i4.Key, @"(\w{1})(\d{1,3})").Groups[1].Value;
                foreach (var group in groups.Where(group => group.Name == groupName))
                {
                    group.SubGroups.Add(new SubGroup(i4.Key, i4.Value.ToString()));
                }
            }
            var groupsSorted = groups.Select(group => new ApplicationGroup {
                Name      = group.Name,
                Text      = group.Text,
                Ico       = group.Ico,
                SubGroups = group.SubGroups.OrderBy(x => x.Name).ToList()
            }).ToList();

            return(groupsSorted.OrderBy(x => x.Name).ToList());
        }
Example #2
0
        public static List <string> GetGroupNames()
        {
            var groupNames = PageLangManager.GetGroupsContent(Langs.LangsEnum.En.ToString()).Select(@group => @group.Key).ToList();

            return(groupNames);
        }