more settings work

This commit is contained in:
TheXamlGuy
2024-02-11 22:18:40 +00:00
parent 812556f8b0
commit 6e738becd4
33 changed files with 152 additions and 80 deletions
+6 -17
View File
@@ -3,24 +3,13 @@ using Microsoft.Extensions.Hosting;
namespace Hyperbar.Widget;
public sealed class WidgetHost :
public sealed class WidgetHost(IServiceProvider services,
IPublisher publisher,
IProxyService<IPublisher> proxyPublisher,
IEnumerable<IHostedService> hostedServices) :
IWidgetHost
{
private readonly IServiceProvider services;
private readonly IPublisher publisher;
private readonly IProxyService<IMediator> proxyMediator;
private readonly IEnumerable<IHostedService> hostedServices;
public WidgetHost(IServiceProvider services,
IPublisher publisher,
IProxyService<IMediator> proxyMediator,
IEnumerable<IHostedService> hostedServices)
{
this.services = services;
this.publisher = publisher;
this.proxyMediator = proxyMediator;
this.hostedServices = hostedServices;
}
private readonly IPublisher publisher = publisher;
public WidgetConfiguration Configuration =>
Services.GetRequiredService<WidgetConfiguration>();
@@ -39,7 +28,7 @@ public sealed class WidgetHost :
await service.StartAsync(cancellationToken);
}
if (proxyMediator.Proxy is IMediator mediator)
if (proxyPublisher.Proxy is IPublisher publisher)
{
await publisher.PublishAsync(new Started<IWidgetHost>(this),
cancellationToken);