mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-23 22:45:06 -04:00
imported signalr 1.1.3 into NzbDrone.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.AspNet.SignalR.Hubs
|
||||
{
|
||||
public class DefaultHubActivator : IHubActivator
|
||||
{
|
||||
private readonly IDependencyResolver _resolver;
|
||||
|
||||
public DefaultHubActivator(IDependencyResolver resolver)
|
||||
{
|
||||
_resolver = resolver;
|
||||
}
|
||||
|
||||
public IHub Create(HubDescriptor descriptor)
|
||||
{
|
||||
if (descriptor == null)
|
||||
{
|
||||
throw new ArgumentNullException("descriptor");
|
||||
}
|
||||
|
||||
if(descriptor.HubType == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
object hub = _resolver.Resolve(descriptor.HubType) ?? Activator.CreateInstance(descriptor.HubType);
|
||||
return hub as IHub;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user