diff --git a/Example.Backend/Example.Backend.csproj b/Example.Backend/Example.Backend.csproj
index 06f0ed2..95845de 100644
--- a/Example.Backend/Example.Backend.csproj
+++ b/Example.Backend/Example.Backend.csproj
@@ -15,7 +15,7 @@
-
+ TRACE;
diff --git a/Example.Backend/Printer.cs b/Example.Backend/Printer.cs
index c001071..65125f4 100644
--- a/Example.Backend/Printer.cs
+++ b/Example.Backend/Printer.cs
@@ -10,7 +10,7 @@ namespace Example.Backend
{
public string Name;
- public void OnPrintExternal(IPage p0, RequestContext p1)
+ public void OnPrintExternal(IPage p0)
{
}
@@ -27,12 +27,12 @@ namespace Example.Backend
// throw new Exception("The method or operation is not implemented.");
var page = new Page { Text = text };
Console.WriteLine($"Request id : :{context.RequestId}");
- OnPrint?.Invoke(page, context);
+ OnPrint?.Invoke(page);
Resource /= 1.5;
return page;
}
- public event Action? OnPrint;
+ public event Action? OnPrint;
public void Dispose()
{
diff --git a/Example.Frontend/ClientBasedPrinter.cs b/Example.Frontend/ClientBasedPrinter.cs
index ed45914..e749687 100644
--- a/Example.Frontend/ClientBasedPrinter.cs
+++ b/Example.Frontend/ClientBasedPrinter.cs
@@ -8,7 +8,7 @@ namespace Example.Frontend
{
public class ClientBasedPrinter : IPrinter
{
- public void OnPrintExternal(IPage p0, RequestContext p1)
+ public void OnPrintExternal(IPage p0)
{
}
@@ -29,7 +29,7 @@ namespace Example.Frontend
return new ClientBasedPage();
}
- public event Action? OnPrint;
+ public event Action? OnPrint;
public void Dispose()
{
diff --git a/Example.Frontend/Example.Frontend.csproj b/Example.Frontend/Example.Frontend.csproj
index 8ad6b28..fdac1b1 100644
--- a/Example.Frontend/Example.Frontend.csproj
+++ b/Example.Frontend/Example.Frontend.csproj
@@ -10,7 +10,7 @@
-
+ TRACE;
diff --git a/Example.Frontend/Program.cs b/Example.Frontend/Program.cs
index 07bd283..077c228 100644
--- a/Example.Frontend/Program.cs
+++ b/Example.Frontend/Program.cs
@@ -48,6 +48,7 @@ class Program
//правильный порядок команд 8-5-10-7
using (var disposingPrinter = factory.Create("Test"))
{
+ disposingPrinter.OnPrint += page1 => { Console.WriteLine("New page creater. Called from event!!!"); };
Console.WriteLine("Printer created");
Thread.Sleep(100);
diff --git a/Example.Shared/IPrinter.cs b/Example.Shared/IPrinter.cs
index f5b25f0..3b320fd 100644
--- a/Example.Shared/IPrinter.cs
+++ b/Example.Shared/IPrinter.cs
@@ -12,6 +12,6 @@ namespace Example.Shared
double Resource { get; set; }
string GetName();
Task Print(string text, bool someParameter, RequestContext context, CancellationToken cancellationToken);
- event Action OnPrint;
+ event Action OnPrint;
}
}
\ No newline at end of file
diff --git a/mROA.Codegen/mROASourceGenerator.cs b/mROA.Codegen/mROASourceGenerator.cs
index cc8d06b..4a32063 100644
--- a/mROA.Codegen/mROASourceGenerator.cs
+++ b/mROA.Codegen/mROASourceGenerator.cs
@@ -463,7 +463,8 @@ namespace {classSymbol.ContainingNamespace.ToDisplayString()}
JoinWithComa(Enumerable.Range(0, parameters.Count).Select(i => "p" + i++)));
var transferParameters =
- JoinWithComa(parameters.Where(i => ParameterFilterForType(i)).Select(i => "p" + parameters.IndexOf(i)));
+ JoinWithComa(parameters.Where(i => !ParameterFilterForType(i))
+ .Select(i => "p" + parameters.IndexOf(i)));
var callFilter = "";
@@ -475,11 +476,13 @@ namespace {classSymbol.ContainingNamespace.ToDisplayString()}
var eventBinderCode =
$@" (instance as {baseType.ToDisplayString()}).{eventSymbol.Name} += ({parametersDeclaration}) =>
- {{ {callFilter}
- var request = new DefaultCallRequest
- {{
- CommandId = {index}, ObjectId = index, Parameters = new object[] {{ {transferParameters} }}
- }};
+ {{
+ Console.WriteLine(""Sending event..."");
+{callFilter}
+ var request = new DefaultCallRequest
+ {{
+ CommandId = {index}, ObjectId = index, Parameters = new object[] {{ {transferParameters} }}
+ }};
module.PostCallMessageAsync(request.Id, MessageType.EventRequest, request);
}};
";
diff --git a/mROA/Implementation/RepresentationModule.cs b/mROA/Implementation/RepresentationModule.cs
index 73e2275..c04f160 100644
--- a/mROA/Implementation/RepresentationModule.cs
+++ b/mROA/Implementation/RepresentationModule.cs
@@ -7,8 +7,8 @@ namespace mROA.Implementation
{
public class RepresentationModule : IRepresentationModule
{
- private ISerializationToolkit? _serialization;
private INextGenerationInteractionModule? _interaction;
+ private ISerializationToolkit? _serialization;
public void Inject(T dependency)
{
@@ -70,6 +70,11 @@ namespace mROA.Implementation
}
}
+ if (fromBuffer == null)
+ {
+ return Array.Empty();
+ }
+
_interaction.HandleMessage(fromBuffer);
return fromBuffer.Data;
}