2025-02-20 16:10:09 +03:00
|
|
|
using System;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Example.Shared;
|
2025-02-13 19:38:54 +03:00
|
|
|
using mROA.Implementation;
|
|
|
|
|
|
2025-02-20 16:10:09 +03:00
|
|
|
namespace Example.Frontend
|
2025-02-13 19:38:54 +03:00
|
|
|
{
|
2025-02-20 16:10:09 +03:00
|
|
|
public class ClientBasedPrinter : IPrinter
|
2025-02-13 19:38:54 +03:00
|
|
|
{
|
2025-03-11 19:42:10 +03:00
|
|
|
public void OnPrintExternal(IPage p0, RequestContext ro)
|
2025-03-10 00:00:24 +03:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-08 23:22:59 +03:00
|
|
|
public double Resource { get; set; }
|
2025-03-08 19:46:59 +03:00
|
|
|
|
2025-02-20 16:10:09 +03:00
|
|
|
public string GetName()
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("ClientBasedPrinter called from server!!!!!!!!!!! Vova likes that:)");
|
2025-03-10 00:00:24 +03:00
|
|
|
|
2025-02-20 16:10:09 +03:00
|
|
|
return "ClientBasedPrinter from mroa";
|
|
|
|
|
}
|
2025-02-13 19:38:54 +03:00
|
|
|
|
2025-03-10 00:00:24 +03:00
|
|
|
public async Task<IPage> Print(string text, bool some, RequestContext context,
|
|
|
|
|
CancellationToken cancellationToken)
|
2025-02-20 16:10:09 +03:00
|
|
|
{
|
|
|
|
|
Console.WriteLine($"Printed: {text}");
|
|
|
|
|
await Task.Yield();
|
|
|
|
|
return new ClientBasedPage();
|
|
|
|
|
}
|
2025-02-23 10:18:38 +03:00
|
|
|
|
2025-03-11 19:42:10 +03:00
|
|
|
public event Action<IPage, RequestContext>? OnPrint;
|
2025-03-07 09:01:21 +03:00
|
|
|
|
2025-02-23 10:18:38 +03:00
|
|
|
public void Dispose()
|
|
|
|
|
{
|
|
|
|
|
}
|
2025-02-13 19:38:54 +03:00
|
|
|
}
|
|
|
|
|
|
2025-02-20 16:10:09 +03:00
|
|
|
public class ClientBasedPage : IPage
|
2025-02-13 19:38:54 +03:00
|
|
|
{
|
2025-02-20 16:10:09 +03:00
|
|
|
public byte[] GetData()
|
|
|
|
|
{
|
|
|
|
|
return new byte[] { 1, 2, 3 };
|
|
|
|
|
}
|
2025-02-13 19:38:54 +03:00
|
|
|
}
|
|
|
|
|
}
|