protected override void OnProjectChanged(object sender) { _parent = null; _template = null; }
private Template CreateTemplate([NotNull] IProject project) { var template = new Template(project, TextNode.Empty, Guid.NewGuid(), "master", "dummy template", Guid.NewGuid().ToString()); var stringField = new TemplateField(template, Guid.NewGuid(), null) { Type = "Single-Line Text", FieldName = "Text" }; var checkboxField = new TemplateField(template, Guid.NewGuid(), null) { Type = "Checkbox", FieldName = "Checkbox" }; var section = new TemplateSection(template, Guid.NewGuid(), null); section.Fields.Add(stringField); section.Fields.Add(checkboxField); template.Sections.Add(section); project.AddOrMerge(template); return template; }
public virtual TemplateSection TemplateSection(Template template, Guid guid, ITextNode templateSectionTextNode) { return new TemplateSection(template, guid, templateSectionTextNode); }
public virtual TemplateField TemplateField(Template template, Guid guid, ITextNode templateFieldTextNode) { return new TemplateField(template, guid, templateFieldTextNode); }
public override void WriteTemplate(TextWriter textWriter, Template template) { template.WriteAsXml(textWriter); }
public abstract void WriteTemplate(TextWriter textWriter, Template template);