You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
810 B
32 lines
810 B
using System;
|
|
using Microsoft.AspNet.SignalR;
|
|
using NzbDrone.Common.Composition;
|
|
|
|
namespace NzbDrone.Api.SignalR
|
|
{
|
|
public class SignalrDependencyResolver : DefaultDependencyResolver
|
|
{
|
|
private readonly IContainer _container;
|
|
|
|
public static void Register(IContainer container)
|
|
{
|
|
GlobalHost.DependencyResolver = new SignalrDependencyResolver(container);
|
|
}
|
|
|
|
private SignalrDependencyResolver(IContainer container)
|
|
{
|
|
_container = container;
|
|
}
|
|
|
|
public override object GetService(Type serviceType)
|
|
{
|
|
if (_container.IsTypeRegistered(serviceType))
|
|
{
|
|
return _container.Resolve(serviceType);
|
|
}
|
|
|
|
return base.GetService(serviceType);
|
|
}
|
|
}
|
|
}
|