diff --git a/Example.Shared/Example.Shared.csproj b/Example.Shared/Example.Shared.csproj
index 40a196f..db58133 100644
--- a/Example.Shared/Example.Shared.csproj
+++ b/Example.Shared/Example.Shared.csproj
@@ -13,4 +13,8 @@
+
+
+
+
diff --git a/Example.Shared/ILoadTest.cs b/Example.Shared/ILoadTest.cs
index 227af99..a6b8d15 100644
--- a/Example.Shared/ILoadTest.cs
+++ b/Example.Shared/ILoadTest.cs
@@ -1,5 +1,6 @@
using System.Threading;
using System.Threading.Tasks;
+using mROA.Abstract;
using mROA.Implementation;
using mROA.Implementation.Attributes;
@@ -15,4 +16,35 @@ namespace Example.Shared
Task AsyncTest(CancellationToken token = default);
}
+
+ partial class LoadTestRemoteEndpoint2
+ : RemoteObjectBase, ILoadTest
+ {
+ public LoadTestRemoteEndpoint2(int id, IRepresentationModule representationModule, IEndPointContext context)
+ : base(id, representationModule, context)
+ {
+ }
+
+ public void A(){
+ CallAsync(0).Wait();
+ }
+
+ public async System.Threading.Tasks.Task AsyncTest(System.Threading.CancellationToken token){
+ await CallAsync(1, cancellationToken : token);
+ }
+
+ public void C(){
+ CallAsync(2).Wait();
+ }
+
+ public System.Int32 Last(System.Int32 next){
+ return GetResultAsync(3, new System.Object[] { next }).GetAwaiter().GetResult();
+ }
+
+ public System.Int32 Next(System.Int32 last){
+ return GetResultAsync(4, new System.Object[] { last }).GetAwaiter().GetResult();
+ }
+
+
+ }
}
\ No newline at end of file
diff --git a/mROA.Codegen/Tools/DefineTemplateSection.cs b/mROA.Codegen/Tools/DefineTemplateSection.cs
deleted file mode 100644
index e572e70..0000000
--- a/mROA.Codegen/Tools/DefineTemplateSection.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-namespace mROA.Codegen.Tools
-{
- public class DefineTemplateSection : ITagged
- {
- public DefineTemplateSection(string storedText, string tag, TemplateDocument context)
- {
- StoredText = storedText;
- Tag = tag;
- Context = context;
- }
-
- public string StoredText { get; }
- public TemplateDocument Context { get; set; }
-
- public string Tag { get; }
-
- public int TargetLength => StoredText.Length;
-
- public object Clone()
- {
- return new DefineTemplateSection(StoredText, Tag, Context);
- }
-
-
- public override string ToString()
- {
- return StoredText;
- }
- }
-}
\ No newline at end of file
diff --git a/mROA.Codegen/Tools/ITemplateSection.cs b/mROA.Codegen/Tools/ITemplateSection.cs
deleted file mode 100644
index 24a8e47..0000000
--- a/mROA.Codegen/Tools/ITemplateSection.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-namespace mROA.Codegen.Tools
-{
- 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.Codegen/Tools/InnerTemplateSection.cs b/mROA.Codegen/Tools/InnerTemplateSection.cs
deleted file mode 100644
index 56308cb..0000000
--- a/mROA.Codegen/Tools/InnerTemplateSection.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-namespace mROA.Codegen.Tools
-{
- public class InnerTemplateSection : ITemplateSection, ITagged
- {
- public InnerTemplateSection(string tag, TemplateDocument innerTemplate, TemplateDocument context)
- {
- Tag = tag;
- Context = context;
- InnerTemplate = innerTemplate;
- }
-
- public TemplateDocument InnerTemplate { get; }
-
- public string Tag { get; }
-
- public TemplateDocument Context { get; set; }
- public int TargetLength => 0;
-
- public object Clone()
- {
- return new InnerTemplateSection(Tag, InnerTemplate, Context);
- }
- }
-}
\ No newline at end of file
diff --git a/mROA.Codegen/Tools/InsertTemplateSection.cs b/mROA.Codegen/Tools/InsertTemplateSection.cs
deleted file mode 100644
index 097a8e8..0000000
--- a/mROA.Codegen/Tools/InsertTemplateSection.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-
-namespace mROA.Codegen.Tools
-{
- public class InsertTemplateSection : ITagged, IBaking
- {
- public readonly List Parameters;
- private object _insertedValue;
-
- public InsertTemplateSection(string tag, TemplateDocument context, params string[] parameters)
- {
- Tag = tag;
- Parameters = parameters.ToList();
- Context = context;
- }
-
- public string Bake()
- {
- switch (_insertedValue)
- {
- case null:
- return string.Empty;
- case string s:
- return s;
- default:
- return ((ITemplateSection)_insertedValue).ToString();
- }
- }
-
- public string Tag { get; private set; }
-
- public TemplateDocument Context { get; set; }
-
-
- public int TargetLength => 0;
-
- public object Clone()
- {
- return new InsertTemplateSection(Tag, Context, Parameters.ToArray());
- }
-
- private bool IsInserted(object value)
- {
- if (Parameters.IndexOf("r") == -1) return false;
-
- ProduceInserted(value);
-
- return true;
- }
-
- private void ProduceInserted(object value)
- {
- var currentIndex = Context.Parts.IndexOf(this);
- var clone = (InsertTemplateSection)MemberwiseClone();
- clone.Tag += "+";
-
- clone._insertedValue = value;
-
- Context.Parts.Insert(currentIndex, clone);
-
- InsertSeparator(currentIndex + 1);
- }
-
- private void InsertSeparator(int currentIndex)
- {
- var sepIndex = Parameters.IndexOf("sep");
- if (sepIndex == -1)
- return;
-
- Context.Parts.Insert(currentIndex,
- new LiteralTemplateSection(Context[Parameters[sepIndex + 1]].ToString(), Context));
- }
-
-
- public void Setup(object value)
- {
- if (!(value is string) && !(value is ITemplateSection))
- return;
- if (IsInserted(value))
- return;
-
- _insertedValue = value;
- }
- }
-}
\ No newline at end of file
diff --git a/mROA.Codegen/Tools/LinkTemplateSection.cs b/mROA.Codegen/Tools/LinkTemplateSection.cs
deleted file mode 100644
index af9e255..0000000
--- a/mROA.Codegen/Tools/LinkTemplateSection.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-namespace mROA.Codegen.Tools
-{
- public class LinkTemplateSection : ITemplateSection, IBaking
- {
- public LinkTemplateSection(string linkedTag, TemplateDocument context)
- {
- LinkedTag = linkedTag;
- Context = context;
- }
-
- public string LinkedTag { get; }
-
- public string Bake()
- {
- return Context[LinkedTag]?.ToString();
- }
-
- public TemplateDocument Context { get; set; }
-
- public int TargetLength
- {
- get
- {
- var attached = Context[LinkedTag];
- return attached?.TargetLength ?? 0;
- }
- }
-
- public object Clone()
- {
- return new LinkTemplateSection(LinkedTag, Context);
- }
-
- public override string ToString()
- {
- return $"{nameof(LinkedTag)}: {LinkedTag}";
- }
- }
-}
\ No newline at end of file
diff --git a/mROA.Codegen/Tools/LiteralTemplateSection.cs b/mROA.Codegen/Tools/LiteralTemplateSection.cs
deleted file mode 100644
index e55cd9c..0000000
--- a/mROA.Codegen/Tools/LiteralTemplateSection.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-namespace mROA.Codegen.Tools
-{
- public class LiteralTemplateSection : ITemplateSection, IBaking
- {
- private readonly string _internalText;
-
- public LiteralTemplateSection(string internalText, TemplateDocument context)
- {
- _internalText = internalText;
- Context = context;
- }
-
- public string Bake()
- {
- return ToString();
- }
-
- public TemplateDocument Context { get; set; }
- public int TargetLength => _internalText.Length;
-
- public object Clone()
- {
- return new LiteralTemplateSection(_internalText, Context);
- }
-
- public override string ToString()
- {
- return _internalText;
- }
- }
-}
\ No newline at end of file
diff --git a/mROA.Codegen/Tools/ProgrammableTextSection.cs b/mROA.Codegen/Tools/ProgrammableTextSection.cs
deleted file mode 100644
index 11eb037..0000000
--- a/mROA.Codegen/Tools/ProgrammableTextSection.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-
-namespace mROA.Codegen.Tools
-{
- public class ProgrammableTextSection : ITemplateSection, IBaking
- {
- private readonly Func