void InitializeTemplates() { Project project = null; if (!boxProject.Visible || projectAddCheckbox.Active) { project = parentProject; } var templates = FileTemplate.GetFileTemplates(project, basePath); // stable sort, to ensure the template ordering is maintained among templates with the same name templates = templates.OrderBy(t => t.Name).ToList(); foreach (var template in templates) { List <string> langs = template.GetCompatibleLanguages(project, basePath); if (langs != null) { foreach (string language in langs) { AddTemplate(new TemplateItem(template, language), language); //count the number of active languages activeLangs[language] = true; } } } }
void InitializeTemplates() { Project project = null; if (!boxProject.Visible || projectAddCheckbox.Active) { project = parentProject; } var templates = FileTemplate.GetFileTemplates(project, basePath); templates.Sort((FileTemplate t, FileTemplate u) => string.Compare(t.Name, u.Name)); foreach (var template in templates) { List <string> langs = template.GetCompatibleLanguages(project, basePath); if (langs != null) { foreach (string language in langs) { AddTemplate(new TemplateItem(template, language), language); //count the number of active languages activeLangs[language] = true; } } } }