Практически доделанный кодген, но не работает демка
This commit is contained in:
@@ -8,27 +8,31 @@ namespace Example.Frontend
|
||||
{
|
||||
public class ClientBasedPrinter : IPrinter
|
||||
{
|
||||
public void OnPrintExternal(IPage p0, RequestContext p1)
|
||||
{
|
||||
}
|
||||
|
||||
public double Resource { get; set; }
|
||||
|
||||
public string GetName()
|
||||
{
|
||||
Console.WriteLine("ClientBasedPrinter called from server!!!!!!!!!!! Vova likes that:)");
|
||||
|
||||
|
||||
return "ClientBasedPrinter from mroa";
|
||||
}
|
||||
|
||||
public async Task<IPage> Print(string text, bool some, CancellationToken cancellationToken)
|
||||
public async Task<IPage> Print(string text, bool some, RequestContext context,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
Console.WriteLine($"Printed: {text}");
|
||||
await Task.Yield();
|
||||
return new ClientBasedPage();
|
||||
}
|
||||
|
||||
public event Action<IPage>? OnPrint;
|
||||
public event Action<IPage, RequestContext>? OnPrint;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,8 @@ class Program
|
||||
|
||||
Console.WriteLine(string.Join(", ", names));
|
||||
|
||||
var page = disposingPrinter.Print("Test Page", false, CancellationToken.None).GetAwaiter().GetResult();
|
||||
var page = disposingPrinter.Print("Test Page", false, default, CancellationToken.None).GetAwaiter()
|
||||
.GetResult();
|
||||
Console.WriteLine("Page printed");
|
||||
Console.WriteLine(page.ToString());
|
||||
|
||||
@@ -112,7 +113,5 @@ class Program
|
||||
// Console.WriteLine("X is {0}", x);
|
||||
// Console.WriteLine("Time : {0}", timer.Elapsed.TotalMilliseconds);
|
||||
// Console.WriteLine($"Time per call: {timer.Elapsed.TotalMilliseconds / iterations} ms");
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user