예제 #1
0
        public static TemplateGraph Read(string file)
        {
            XmlDocument document = new XmlDocument();

            document.Load(file);
            TemplateGraph graph = new TemplateGraph();

            foreach (XmlElement element in document.DocumentElement.SelectNodes("category"))
            {
                ProjectCategory 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);
        }
예제 #2
0
 public void AddCategory(ProjectCategory category)
 {
     this._categories.Add(category);
 }