Программная часть шаблона
This commit is contained in:
1 parent
de16ee3a70
commit
23e52788a0
3 files changed
+26
-1
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user