public void OneIndexNotSet1() { NewFileDialog.Category category1 = new NewFileDialog.Category("zz", 0); NewFileDialog.Category category2 = new NewFileDialog.Category("aa"); Assert.AreEqual(-1, comparer.Compare(category1, category2)); }
public void IndexEqual1() { NewFileDialog.Category category1 = new NewFileDialog.Category("aa", 0); NewFileDialog.Category category2 = new NewFileDialog.Category("bb", 0); Assert.AreEqual(-1, comparer.Compare(category1, category2)); }
public void IndexNotEqual2() { NewFileDialog.Category category1 = new NewFileDialog.Category("zz", 1); NewFileDialog.Category category2 = new NewFileDialog.Category("zz", 0); Assert.AreEqual(1, comparer.Compare(category1, category2)); }
public void NameNotEqual2() { NewFileDialog.Category category1 = new NewFileDialog.Category("bb"); NewFileDialog.Category category2 = new NewFileDialog.Category("aa"); Assert.AreEqual(1, comparer.Compare(category1, category2)); }
Category CreateCategory(TemplateCategory templateCategory) { Category node = new NewFileDialog.Category(templateCategory.DisplayName); foreach (var subcategory in Sorted(templateCategory.Subcategories)) { var subnode = CreateCategory(subcategory); if (!subnode.IsEmpty) { node.Nodes.Add(subnode); } } foreach (var template in templateCategory.Templates.OfType <FileTemplate>()) { if (!template.IsVisible(project)) { continue; } TemplateItem titem = new TemplateItem(template); if (titem.Template.Icon != null) { icons[titem.Template.Icon] = 0; // "create template icon" } alltemplates.Add(titem); node.Templates.Add(titem); } return(node); }
Category CreateCategory(TemplateCategory templateCategory) { Category node = new NewFileDialog.Category(templateCategory.DisplayName); foreach (var subcategory in Sorted(templateCategory.Subcategories)) { var subnode = CreateCategory(subcategory); if (!subnode.IsEmpty) node.Nodes.Add(subnode); } foreach (var template in templateCategory.Templates.OfType<FileTemplate>()) { if (!template.IsVisible(project)) continue; TemplateItem titem = new TemplateItem(template); if (titem.Template.Icon != null) { icons[titem.Template.Icon] = 0; // "create template icon" } alltemplates.Add(titem); node.Templates.Add(titem); } return node; }