diff --git a/Codegen.Basic/Codegen.Basic.csproj b/Codegen.Basic/Codegen.Basic.csproj
deleted file mode 100644
index 45c45ba..0000000
--- a/Codegen.Basic/Codegen.Basic.csproj
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
- Exe
- net9.0
- enable
- enable
- BasicDemo
-
-
-
-
-
-
-
-
-
- Always
-
-
-
-
diff --git a/Codegen.Basic/Program.cs b/Codegen.Basic/Program.cs
deleted file mode 100644
index de86019..0000000
--- a/Codegen.Basic/Program.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-// See https://aka.ms/new-console-template for more information
-
-using mROA.CodegenTools;
-
-// var doc = new TemplateDocument();
-// doc.Parts = new List
-// {
-// new LiteralTemplateSection("teset text", doc),
-// new DefineTemplateSection(" another text which is dinided, bun not placed ", "text define", doc),
-// new LinkTemplateSection("text define", doc),
-// new LinkTemplateSection("text define", doc),
-// new LinkTemplateSection("text define", doc),
-// new LiteralTemplateSection(" = = = ", doc),
-// new InsertTemplatePart("insert", doc),
-// new LinkTemplateSection("post", doc)
-// };
-//
-// doc.Insert("insert", "inserted text by insert template => ");
-// doc.Parts.Add(new DefineTemplateSection("post added", "post", doc));
-// Console.WriteLine(doc.Compile());
-var doc = TemplateReader.FromEmbeddedResource("exampleTemplate.cstmpl");
-doc.Insert("ctorInserting", "test inserting");
-Console.WriteLine(doc.Compile());
-
-Console.WriteLine(doc.Parts.Count);
\ No newline at end of file
diff --git a/Codegen.Basic/exampleTemplate.cstmpl b/Codegen.Basic/exampleTemplate.cstmpl
deleted file mode 100644
index 5e47243..0000000
--- a/Codegen.Basic/exampleTemplate.cstmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-public class A
-{
-
-
-
- Some literal for test
- test text with definition in template
-
-
-
-
-
-
- public void ()
- {
- Console.WriteLine("");
- }
-
-}
\ No newline at end of file
diff --git a/mROA.Codegen/RemoteTypeBinder.cstmpl b/mROA.Codegen/RemoteTypeBinder.cstmpl
index 4e7374b..be2bf42 100644
--- a/mROA.Codegen/RemoteTypeBinder.cstmpl
+++ b/mROA.Codegen/RemoteTypeBinder.cstmpl
@@ -39,7 +39,7 @@ namespace mROA.Codegen
Parameters = new object[] { }
};
- module.PostCallMessageAsync(request.Id, MessageType.EventRequest, request);
+ module.PostCallMessageAsync(request.Id, EMessageType.EventRequest, request);
};
}
diff --git a/mROA.Codegen/mROASourceGenerator.cs b/mROA.Codegen/mROASourceGenerator.cs
index 15407b5..6329ab2 100644
--- a/mROA.Codegen/mROASourceGenerator.cs
+++ b/mROA.Codegen/mROASourceGenerator.cs
@@ -173,10 +173,6 @@ namespace mROA.Codegen
{
var coCodegenRepoCode = _methodRepoTemplate.Compile();
#if !DONT_ADD
- var template = TemplateReader.FromEmbeddedResource("TestClass.cstmpl");
- template.AddDefine("param", "System.Int32 i");
-
- context.AddSource("TestClass.g.cs", SourceText.From(template.Compile(), Encoding.UTF8));
context.AddSource("CoCodegenMethodRepository.g.cs", SourceText.From(coCodegenRepoCode, Encoding.UTF8));
#endif
}
diff --git a/mROA.CodegenTools/DefineTemplateSection.cs b/mROA.CodegenTools/DefineTemplateSection.cs
deleted file mode 100644
index fcc926e..0000000
--- a/mROA.CodegenTools/DefineTemplateSection.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System;
-
-namespace mROA.CodegenTools
-{
- public class DefineTemplateSection : ITagged
- {
- public TemplateDocument Context { get; set; }
- public string StoredText { get; }
- private readonly string _tag;
-
- public DefineTemplateSection(string storedText, string tag, TemplateDocument context)
- {
- StoredText = storedText;
- _tag = tag;
- Context = context;
- }
-
- public string Tag => _tag;
- public int TargetLength => StoredText.Length;
-
-
- public override string ToString()
- {
- return StoredText;
- }
-
- public object Clone()
- {
- return new DefineTemplateSection(StoredText, _tag, Context);
- }
- }
-}
\ No newline at end of file
diff --git a/mROA.CodegenTools/ITemplateSection.cs b/mROA.CodegenTools/ITemplateSection.cs
deleted file mode 100644
index 7712282..0000000
--- a/mROA.CodegenTools/ITemplateSection.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-
-namespace mROA.CodegenTools
-{
- public interface ITemplateSection : ICloneable
- {
- TemplateDocument Context { get; set; }
- int TargetLength { get; }
- }
-
- public interface IBaking
- {
- string Bake();
- }
-
-
- public interface ITagged : ITemplateSection
- {
- string Tag { get; }
- }
-}
\ No newline at end of file
diff --git a/mROA.CodegenTools/InnerTemplateSection.cs b/mROA.CodegenTools/InnerTemplateSection.cs
deleted file mode 100644
index f347086..0000000
--- a/mROA.CodegenTools/InnerTemplateSection.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-namespace mROA.CodegenTools
-{
- public class InnerTemplateSection : ITemplateSection, ITagged
- {
- private readonly string _tag;
- public TemplateDocument Context { get; set; }
- public int TargetLength => 0;
-
- public string Tag => _tag;
-
- public TemplateDocument InnerTemplate { get; }
-
- public InnerTemplateSection(string tag, TemplateDocument innerTemplate, TemplateDocument context)
- {
- _tag = tag;
- Context = context;
- InnerTemplate = innerTemplate;
- }
-
- public object Clone()
- {
- return new InnerTemplateSection(_tag, InnerTemplate, Context);
- }
- }
-}
\ No newline at end of file
diff --git a/mROA.CodegenTools/InsertTemplatePart.cs b/mROA.CodegenTools/InsertTemplatePart.cs
deleted file mode 100644
index fbc8f53..0000000
--- a/mROA.CodegenTools/InsertTemplatePart.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace mROA.CodegenTools
-{
- public class InsertTemplatePart : ITagged, IBaking
- {
- private object _insertedValue;
- private string _tag;
- public string Tag => _tag;
- public TemplateDocument Context { get; set; }
- public readonly List Parameters;
-
- public InsertTemplatePart(string tag, TemplateDocument context, params string[] parameters)
- {
- _tag = tag;
- Parameters = parameters.ToList();
- Context = context;
- }
-
- private bool IsInserted(object value)
- {
- if (Parameters.IndexOf("R") == 0) return false;
-
- ProduceInserted(value);
-
- return true;
- }
-
- private void ProduceInserted(object value)
- {
- var currentIndex = Context.Parts.IndexOf(this);
- var clone = (InsertTemplatePart)MemberwiseClone();
- clone._tag += "+";
-
- clone._insertedValue = value;
-
- Context.Parts.Insert(currentIndex, clone);
- }
-
-
- public void Setup(object value)
- {
- if (!(value is string) && !(value is ITemplateSection) )
- return;
- if (IsInserted(value))
- return;
-
- _insertedValue = value;
- }
-
-
- public int TargetLength => 0;
-
- public string Bake()
- {
- switch (_insertedValue)
- {
- case null:
- return string.Empty;
- case string s:
- return s;
- default:
- return ((ITemplateSection)_insertedValue).ToString();
- }
- }
-
- public object Clone()
- {
- return new InsertTemplatePart(_tag, Context, Parameters.ToArray());
- }
- }
-}
\ No newline at end of file
diff --git a/mROA.CodegenTools/LinkTemplateSection.cs b/mROA.CodegenTools/LinkTemplateSection.cs
deleted file mode 100644
index 8870674..0000000
--- a/mROA.CodegenTools/LinkTemplateSection.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System.Linq;
-
-namespace mROA.CodegenTools
-{
- public class LinkTemplateSection : ITemplateSection, IBaking
- {
- private readonly string _linkedTag;
-
- public LinkTemplateSection(string linkedTag, TemplateDocument context)
- {
- _linkedTag = linkedTag;
- Context = context;
- }
-
- public TemplateDocument Context { get; set; }
-
- public string LinkedTag => _linkedTag;
-
- public int TargetLength
- {
- get
- {
- var attached = Context[_linkedTag];
- return attached?.TargetLength ?? 0;
- }
- }
-
- public string Bake()
- {
- return Context[_linkedTag]?.ToString();
- }
-
- public override string ToString()
- {
- return $"{nameof(LinkedTag)}: {_linkedTag}";
- }
-
- public object Clone()
- {
- return new LinkTemplateSection(_linkedTag, Context);
- }
- }
-}
\ No newline at end of file
diff --git a/mROA.CodegenTools/LiteralTemplateSection.cs b/mROA.CodegenTools/LiteralTemplateSection.cs
deleted file mode 100644
index b28fe72..0000000
--- a/mROA.CodegenTools/LiteralTemplateSection.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-namespace mROA.CodegenTools
-{
- public class LiteralTemplateSection : ITemplateSection, IBaking
- {
- private string _internalText;
-
- public LiteralTemplateSection(string internalText, TemplateDocument context)
- {
- _internalText = internalText;
- Context = context;
- }
-
- public TemplateDocument Context { get; set; }
- public int TargetLength => _internalText.Length;
-
- public string Bake()
- {
- return ToString();
- }
-
- public override string ToString()
- {
- return _internalText;
- }
-
- public object Clone()
- {
- return new LiteralTemplateSection(_internalText, Context);
- }
- }
-}
\ No newline at end of file
diff --git a/mROA.CodegenTools/ProgrammableTextSection.cs b/mROA.CodegenTools/ProgrammableTextSection.cs
deleted file mode 100644
index 5d91bd5..0000000
--- a/mROA.CodegenTools/ProgrammableTextSection.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-
-namespace mROA.CodegenTools
-{
- public class ProgrammableTextSection : ITemplateSection, IBaking
- {
- public TemplateDocument Context { get; set; }
- public int TargetLength => 0;
-
- private Func