Переписывание евент-биндеров

This commit is contained in:
2025-03-26 14:43:06 +03:00
parent 5d5c3d1e2b
commit c4d9a54942
5 changed files with 69 additions and 63 deletions
@@ -4,7 +4,7 @@ using System.Linq;
namespace mROA.CodegenTools
{
public class InsertTemplatePart : ITagged, IBaking
public class InsertTemplateSection : ITagged, IBaking
{
private object _insertedValue;
private string _tag;
@@ -12,7 +12,7 @@ namespace mROA.CodegenTools
public TemplateDocument Context { get; set; }
public readonly List<string> Parameters;
public InsertTemplatePart(string tag, TemplateDocument context, params string[] parameters)
public InsertTemplateSection(string tag, TemplateDocument context, params string[] parameters)
{
_tag = tag;
Parameters = parameters.ToList();
@@ -31,7 +31,7 @@ namespace mROA.CodegenTools
private void ProduceInserted(object value)
{
var currentIndex = Context.Parts.IndexOf(this);
var clone = (InsertTemplatePart)MemberwiseClone();
var clone = (InsertTemplateSection)MemberwiseClone();
clone._tag += "+";
clone._insertedValue = value;
@@ -80,7 +80,7 @@ namespace mROA.CodegenTools
public object Clone()
{
return new InsertTemplatePart(_tag, Context, Parameters.ToArray());
return new InsertTemplateSection(_tag, Context, Parameters.ToArray());
}
}
}
@@ -18,7 +18,7 @@ namespace mROA.CodegenTools
var tagText = GetTagValue(from, to);
var parts = tagText.Split(' ');
return new InsertTemplatePart(parts[0], document, parts.Skip(1).ToArray());
return new InsertTemplateSection(parts[0], document, parts.Skip(1).ToArray());
}
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ namespace mROA.CodegenTools
public void Insert(string tag, object value)
{
var selectedPart = this[tag];
if (selectedPart is InsertTemplatePart itp)
if (selectedPart is InsertTemplateSection itp)
{
itp.Setup(value);
}