Enabled ability to order containers and the ability to insert new containers to their correct order
This commit is contained in:
@@ -10,13 +10,16 @@ public class ComponentHost(IServiceProvider services,
|
|||||||
{
|
{
|
||||||
public IServiceProvider Services => services;
|
public IServiceProvider Services => services;
|
||||||
|
|
||||||
public ComponentConfiguration? Configuration =>
|
|
||||||
Services.GetService<ComponentConfiguration>();
|
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TConfiguration? GetConfiguration<TConfiguration>() where TConfiguration : ComponentConfiguration
|
||||||
|
{
|
||||||
|
return Services.GetService<TConfiguration>();
|
||||||
|
}
|
||||||
|
|
||||||
public async Task StartAsync(CancellationToken cancellationToken = default)
|
public async Task StartAsync(CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
foreach (IInitializer initializer in initializers)
|
foreach (IInitializer initializer in initializers)
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ namespace Toolkit.Foundation;
|
|||||||
public interface IComponentHost :
|
public interface IComponentHost :
|
||||||
IHost
|
IHost
|
||||||
{
|
{
|
||||||
ComponentConfiguration? Configuration { get; }
|
TConfiguration? GetConfiguration<TConfiguration>() where TConfiguration : ComponentConfiguration;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user