示例#1
0
        public ProjectCategory AddCategory(string categoryName)
        {
            var category = new ProjectCategory {Type = categoryName};

            _categories.Add(category);

            return category;
        }
示例#2
0
        public static TemplateGraph Read(string file)
        {
            var document = new XmlDocument();
            document.Load(file);

            var graph = new TemplateGraph();

            foreach (XmlElement element in document.DocumentElement.SelectNodes("category"))
            {
                var category = new ProjectCategory {Type = element.GetAttribute("type")};
                foreach (XmlElement projectElement in element.SelectNodes("project"))
                {
                    category.Templates.Add(projectElement.BuildProjectTemplate());
                }

                graph._categories.Add(category);
            }

            return graph;
        }
示例#3
0
        public static TemplateGraph Read(string file)
        {
            var document = new XmlDocument();

            document.Load(file);

            var graph = new TemplateGraph();

            foreach (XmlElement element in document.DocumentElement.SelectNodes("category"))
            {
                var category = new ProjectCategory {
                    Type = element.GetAttribute("type")
                };
                foreach (XmlElement projectElement in element.SelectNodes("project"))
                {
                    category.Templates.Add(projectElement.BuildProjectTemplate());
                }

                graph._categories.Add(category);
            }


            return(graph);
        }
示例#4
0
 public void AddCategory(ProjectCategory category)
 {
     _categories.Add(category);
 }
示例#5
0
 public void AddCategory(ProjectCategory category)
 {
     _categories.Add(category);
 }
        public void smoke_test()
        {
            var category = new ProjectCategory
            {
                Type = "new"
            };

            category.Templates.Add(new ProjectTemplate
            {
                Name = "web-app",
                Description = "FubuMVC application",
                Options = new List<Option>
                {
                    new Option("raven").DescribedAs("RavenDb database integration"),
                    new Option("authentication").DescribedAs("FubuMVC.Authentication integration"),
                    new Option("validation").DescribedAs("FubuMVC.Validation integration")

                },
                Selections = new List<OptionSelection>
                {
                    new OptionSelection{Name = "view-engine", Description = "Choice of view engine", Options = new List<Option>
                    {
                        new Option("none").DescribedAs("No view engine"),
                        new Option("spark").DescribedAs("Spark Views"),
                        new Option("razor").DescribedAs("Razor Views")
                    }},
                    new OptionSelection{Name = "ioc", Description = "IoC container", Options = new List<Option>
                    {
                        new Option("structuremap").DescribedAs("StructureMap"),
                        new Option("autofac").DescribedAs("Autofac"),
                    }},
                }
            });

            category.Templates.Add(new ProjectTemplate
            {
                Name = "library",
                Description = "Simple class library project"
            });

            category.Templates.Add(new ProjectTemplate
            {
                Name = "web-bottle",
                Description = "FubuMVC Bottle",
                Options = new List<Option>
                {
                    new Option("raven").DescribedAs("RavenDb database integration"),
                    new Option("validation").DescribedAs("FubuMVC.Validation integration")
                },
                Selections = new List<OptionSelection>
                {
                    new OptionSelection{Name = "view-engine", Description = "Choice of view engine", Options = new List<Option>
                    {
                        new Option("none").DescribedAs("No view engine"),
                        new Option("spark").DescribedAs("Spark Views"),
                        new Option("razor").DescribedAs("Razor Views")
                    }}
                }
            });

            category.WriteDescriptionToConsole();
        }