Практически доделанный кодген, но не работает демка

This commit is contained in:
2025-03-10 00:00:24 +03:00
parent e0088ea22c
commit 0dbc065d9e
18 changed files with 248 additions and 149 deletions
+9 -4
View File
@@ -10,6 +10,10 @@ namespace Example.Backend
{
public string Name;
public void OnPrintExternal(IPage p0, RequestContext p1)
{
}
public double Resource { get; set; } = 100d;
public string GetName()
@@ -17,22 +21,23 @@ namespace Example.Backend
return Name;
}
public async Task<IPage> Print(string text, bool some, CancellationToken cancellationToken = default)
public async Task<IPage> Print(string text, bool some, RequestContext context,
CancellationToken cancellationToken = default)
{
// throw new Exception("The method or operation is not implemented.");
var page = new Page { Text = text };
OnPrint?.Invoke(page);
Console.WriteLine($"Request id : :{context.RequestId}");
OnPrint?.Invoke(page, context);
Resource /= 1.5;
return page;
}
public event Action<IPage>? OnPrint;
public event Action<IPage, RequestContext>? OnPrint;
public void Dispose()
{
Console.WriteLine(
"Dispose printer with name {0}, Dispose works, Dispose works, Dispose works, Dispose works,", Name);
}
}
}