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); }
public void AddCategory(ProjectCategory category) { this._categories.Add(category); }