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));
		}
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
		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;
		}