static public List <TemplateGroup> GetTemplates(TemplateCollection templates) { var items = GetGroupNames(templates); var list = new List <TemplateGroup>(); items.Sort(); foreach (string g in items) { list.Add(new TemplateGroup { GroupName = g, Templates = templates.Templates.Where(tpl => tpl.Group == g).OrderBy(tpl => tpl.Alias) }); } return(list); }
static TemplateGroup GetGroup(TemplateCollection templates, string groupOn) { return(new TemplateGroup { GroupName = groupOn, Templates = templates.Templates.Where(tpl => tpl.Group == groupOn) }); }