Merge pull request #323 from jl0pd/expose-service-container
Expose IServiceContainer
This commit is contained in:
Коммит
89e10f0a25
|
@ -36,6 +36,12 @@ namespace AvaloniaEdit.Utils
|
|||
{
|
||||
private readonly Dictionary<Type, object> _services = new Dictionary<Type, object>();
|
||||
|
||||
public ServiceContainer()
|
||||
{
|
||||
_services.Add(typeof(IServiceProvider), this);
|
||||
_services.Add(typeof(IServiceContainer), this);
|
||||
}
|
||||
|
||||
public object GetService(Type serviceType)
|
||||
{
|
||||
_services.TryGetValue(serviceType, out var service);
|
||||
|
|
Загрузка…
Ссылка в новой задаче