Skip to content

Commit

Permalink
Merge pull request #323 from jl0pd/expose-service-container
Browse files Browse the repository at this point in the history
Expose IServiceContainer
  • Loading branch information
danipen authored Apr 6, 2023
2 parents d5c440c + f51929f commit 89e10f0
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 89e10f0

Please sign in to comment.