Исправлен баг с не правильной генерацией параметров для событий

This commit is contained in:
2025-03-10 17:16:13 +03:00
parent f4a92e4aac
commit b430f1c572
8 changed files with 24 additions and 15 deletions
+2 -2
View File
@@ -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<IPage, RequestContext>? OnPrint;
public event Action<IPage>? OnPrint;
public void Dispose()
{
+1 -1
View File
@@ -10,7 +10,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DefineConstants />
<DefineConstants>TRACE;</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+1
View File
@@ -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);