Пример #1
0
 protected override void OnProjectChanged(object sender)
 {
     _parent = null;
     _template = null;
 }
Пример #2
0
        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;
        }
Пример #3
0
 public virtual TemplateSection TemplateSection(Template template, Guid guid, ITextNode templateSectionTextNode)
 {
     return new TemplateSection(template, guid, templateSectionTextNode);
 }
Пример #4
0
 public virtual TemplateField TemplateField(Template template, Guid guid, ITextNode templateFieldTextNode)
 {
     return new TemplateField(template, guid, templateFieldTextNode);
 }
Пример #5
0
 public override void WriteTemplate(TextWriter textWriter, Template template)
 {
     template.WriteAsXml(textWriter);
 }
Пример #6
0
 public abstract void WriteTemplate(TextWriter textWriter, Template template);