Программная часть шаблона

This commit is contained in:
2025-03-19 23:47:17 +03:00
parent de16ee3a70
commit 23e52788a0
3 changed files with 26 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
using System;
namespace mROA.CodegenTools
{
public class ProgrammableTextPart : ITemplatePart
{
public TemplateDocument Context { get; set; }
public int TargetLength => 0;
private Func<object, string> _bakeFunc;
public ProgrammableTextPart(Func<object, string> bakeFunc, TemplateDocument context)
{
_bakeFunc = bakeFunc;
Context = context;
}
public string Bake()
{
return _bakeFunc(Context.AdditionalContext);
}
}
}