Конструкторы для всех типов частей
This commit is contained in:
@@ -6,11 +6,13 @@ namespace mROA.CodegenTools
|
||||
{
|
||||
public TemplateDocument Context { get; set; }
|
||||
public string StoredText { get; }
|
||||
private string _tag;
|
||||
private readonly string _tag;
|
||||
|
||||
public DefineTemplatePart(string storedText)
|
||||
public DefineTemplatePart(string storedText, string tag, TemplateDocument context)
|
||||
{
|
||||
StoredText = storedText;
|
||||
_tag = tag;
|
||||
Context = context;
|
||||
}
|
||||
|
||||
public string Tag => _tag;
|
||||
|
||||
@@ -5,12 +5,19 @@ namespace mROA.CodegenTools
|
||||
{
|
||||
public class InsertTemplatePart : ITemplatePart, ITagged
|
||||
{
|
||||
private string _insertedText = null;
|
||||
private ITemplatePart _insertedPart = null;
|
||||
private string _insertedText;
|
||||
private ITemplatePart _insertedPart;
|
||||
private string _tag;
|
||||
public string Tag => _tag;
|
||||
public TemplateDocument Context { get; set; }
|
||||
public List<string> Parameters;
|
||||
public readonly List<string> Parameters;
|
||||
|
||||
public InsertTemplatePart(string tag, List<string> parameters, TemplateDocument context)
|
||||
{
|
||||
_tag = tag;
|
||||
Parameters = parameters;
|
||||
Context = context;
|
||||
}
|
||||
|
||||
private bool IsInserted(object value)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,13 @@ namespace mROA.CodegenTools
|
||||
public class LinkTemplatePart : ITemplatePart
|
||||
{
|
||||
private readonly string _linkedTag;
|
||||
|
||||
public LinkTemplatePart(string linkedTag, TemplateDocument context)
|
||||
{
|
||||
_linkedTag = linkedTag;
|
||||
Context = context;
|
||||
}
|
||||
|
||||
public TemplateDocument Context { get; set; }
|
||||
|
||||
public string LinkedTag => _linkedTag;
|
||||
|
||||
@@ -3,6 +3,13 @@ namespace mROA.CodegenTools
|
||||
public class LiteralTemplatePart : ITemplatePart
|
||||
{
|
||||
private string _internalText;
|
||||
|
||||
public LiteralTemplatePart(string internalText, TemplateDocument context)
|
||||
{
|
||||
_internalText = internalText;
|
||||
Context = context;
|
||||
}
|
||||
|
||||
public TemplateDocument Context { get; set; }
|
||||
public string Bake()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user