public XElement GetTemplateByType(CodeFileType type) { var doc = XDocument.Load(Directory.GetCurrentDirectory() + "\\App_Data\\IntelliCode.ct"); return doc.Descendants("Name").Where(d => d.Value == type.ToString()) .Select(d => d.Parent).SingleOrDefault(); }
private void FillDataExtracted(CodeFileType fileType, TextBox obj, TextBox objName) { var section = _template.GetTemplateByType(fileType.ToString()).TemplatSections; obj.Text = section.Find(s => s.Name == "FileLocation").Value; objName.Text = section.Find(s => s.Name == "FileName").Value; }
private void SaveData(CodeFileType fileType, TextBox obj, TextBox objName) { _template.SaveTemplateSection(obj.Text, fileType.ToString(), "FileLocation"); _template.SaveTemplateSection(objName.Text, fileType.ToString(), "FileName"); }