Переименование
This commit is contained in:
+2
-2
@@ -2,13 +2,13 @@ using System;
|
||||
|
||||
namespace mROA.CodegenTools
|
||||
{
|
||||
public class DefineTemplatePart : ITemplatePart, ITagged
|
||||
public class DefineTemplateSection : ITemplateSection, ITagged
|
||||
{
|
||||
public TemplateDocument Context { get; set; }
|
||||
public string StoredText { get; }
|
||||
private readonly string _tag;
|
||||
|
||||
public DefineTemplatePart(string storedText, string tag, TemplateDocument context)
|
||||
public DefineTemplateSection(string storedText, string tag, TemplateDocument context)
|
||||
{
|
||||
StoredText = storedText;
|
||||
_tag = tag;
|
||||
@@ -1,13 +1,13 @@
|
||||
namespace mROA.CodegenTools
|
||||
{
|
||||
public interface ITemplatePart
|
||||
public interface ITemplateSection
|
||||
{
|
||||
TemplateDocument Context { get; set; }
|
||||
int TargetLength { get; }
|
||||
string Bake();
|
||||
}
|
||||
|
||||
public interface ITagged : ITemplatePart
|
||||
public interface ITagged : ITemplateSection
|
||||
{
|
||||
string Tag { get; }
|
||||
}
|
||||
@@ -41,7 +41,7 @@ namespace mROA.CodegenTools
|
||||
|
||||
public void Setup(object value)
|
||||
{
|
||||
if (!(value is string) && !(value is ITemplatePart) )
|
||||
if (!(value is string) && !(value is ITemplateSection) )
|
||||
return;
|
||||
if (IsInserted(value))
|
||||
return;
|
||||
@@ -61,7 +61,7 @@ namespace mROA.CodegenTools
|
||||
case string s:
|
||||
return s;
|
||||
default:
|
||||
return ((ITemplatePart)_insertedValue).Bake();
|
||||
return ((ITemplateSection)_insertedValue).Bake();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@ using System.Linq;
|
||||
|
||||
namespace mROA.CodegenTools
|
||||
{
|
||||
public class LinkTemplatePart : ITemplatePart
|
||||
public class LinkTemplateSection : ITemplateSection
|
||||
{
|
||||
private readonly string _linkedTag;
|
||||
|
||||
public LinkTemplatePart(string linkedTag, TemplateDocument context)
|
||||
public LinkTemplateSection(string linkedTag, TemplateDocument context)
|
||||
{
|
||||
_linkedTag = linkedTag;
|
||||
Context = context;
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
namespace mROA.CodegenTools
|
||||
{
|
||||
public class LiteralTemplatePart : ITemplatePart
|
||||
public class LiteralTemplateSection : ITemplateSection
|
||||
{
|
||||
private string _internalText;
|
||||
|
||||
public LiteralTemplatePart(string internalText, TemplateDocument context)
|
||||
public LiteralTemplateSection(string internalText, TemplateDocument context)
|
||||
{
|
||||
_internalText = internalText;
|
||||
Context = context;
|
||||
+2
-2
@@ -2,14 +2,14 @@ using System;
|
||||
|
||||
namespace mROA.CodegenTools
|
||||
{
|
||||
public class ProgrammableTextPart : ITemplatePart
|
||||
public class ProgrammableTextSection : ITemplateSection
|
||||
{
|
||||
public TemplateDocument Context { get; set; }
|
||||
public int TargetLength => 0;
|
||||
|
||||
private Func<object, string> _bakeFunc;
|
||||
|
||||
public ProgrammableTextPart(Func<object, string> bakeFunc, TemplateDocument context)
|
||||
public ProgrammableTextSection(Func<object, string> bakeFunc, TemplateDocument context)
|
||||
{
|
||||
_bakeFunc = bakeFunc;
|
||||
Context = context;
|
||||
@@ -6,7 +6,7 @@ namespace mROA.CodegenTools
|
||||
{
|
||||
public class TemplateDocument
|
||||
{
|
||||
public List<ITemplatePart> Parts { get; }
|
||||
public List<ITemplateSection> Parts { get; }
|
||||
public object AdditionalContext { get; set; }
|
||||
public ITagged this[string tag] => Parts.OfType<ITagged>().FirstOrDefault(i => i.Tag == tag);
|
||||
public void Insert(string tag, object value)
|
||||
|
||||
Reference in New Issue
Block a user