Skip to content

Commit

Permalink
Expose IServiceContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
jl0pd committed Apr 6, 2023
1 parent d5c440c commit f51929f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/AvaloniaEdit/Utils/IServiceContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ internal class ServiceContainer : IServiceContainer
{
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);
Expand Down

0 comments on commit f51929f

Please sign in to comment.