public DefaultHubTypeResolver(IHubLocator hubLocator)
        {
            if (hubLocator == null)
            {
                throw new ArgumentNullException("hubLocator");
            }

            BuildCache(hubLocator);
        }
Example #2
0
        public DefaultHubTypeResolver(IHubLocator hubLocator)
        {
            if (hubLocator == null)
            {
                throw new ArgumentNullException("hubLocator");
            }

            BuildCache(hubLocator);
        }
Example #3
0
 public HubDispatcher(IHubFactory hubFactory,
                      IMessageStore store,
                      Signaler signaler,
                      IActionResolver actionResolver,
                      IJavaScriptProxyGenerator proxyGenerator,
                      IJsonStringifier jsonStringifier,
                      IHubLocator hubLocator,
                      string url)
     : base(signaler, store, jsonStringifier)
 {
     _hubFactory = hubFactory;
     _store = store;
     _signaler = signaler;
     _actionResolver = actionResolver;
     _proxyGenerator = proxyGenerator;
     _hubLocator = hubLocator;
     _url = VirtualPathUtility.ToAbsolute(url);
 }
Example #4
0
 public HubDispatcher(IHubFactory hubFactory,
                      IMessageStore store,
                      Signaler signaler,
                      IClientIdFactory clientIdFactory,
                      IActionResolver actionResolver,
                      IJavaScriptProxyGenerator proxyGenerator,
                      IJsonStringifier jsonStringifier,
                      IHubLocator hubLocator,
                      string url)
     : base(signaler, clientIdFactory, store, jsonStringifier)
 {
     _hubFactory     = hubFactory;
     _store          = store;
     _signaler       = signaler;
     _actionResolver = actionResolver;
     _proxyGenerator = proxyGenerator;
     _hubLocator     = hubLocator;
     _url            = VirtualPathUtility.ToAbsolute(url);
 }
Example #5
0
        private void BuildCache(IHubLocator hubLocator)
        {
            foreach (var hubType in hubLocator.GetHubs())
            {
                // Always cache by full name
                AddCacheKey(hubType.FullName, hubType);

                // If there's a hub name attribute then use it as an alternative name
                var hubName = ReflectionHelper.GetAttributeValue <HubNameAttribute, string>(hubType, a => a.HubName);

                // Don't add it if it's the same as the short name
                if (!String.Equals(hubName, hubType.Name, StringComparison.OrdinalIgnoreCase))
                {
                    AddCacheKey(hubName, hubType);
                }

                // Add an entry for the type's short name
                AddCacheKey(hubType.Name, hubType);
            }
        }
        private void BuildCache(IHubLocator hubLocator)
        {
            foreach (var hubType in hubLocator.GetHubs())
            {
                // Always cache by full name
                AddCacheKey(hubType.FullName, hubType);

                // If there's a hub name attribute then use it as an alternative name
                var hubName = ReflectionHelper.GetAttributeValue<HubNameAttribute, string>(hubType, a => a.HubName);

                // Don't add it if it's the same as the short name
                if (!String.Equals(hubName, hubType.Name, StringComparison.OrdinalIgnoreCase))
                {
                    AddCacheKey(hubName, hubType);
                }

                // Add an entry for the type's short name
                AddCacheKey(hubType.Name, hubType);
            }
        }
Example #7
0
 public HubDispatcher(IHubFactory hubFactory,
                      IMessageStore store,
                      Signaler signaler,
                      IConnectionIdFactory connectionIdFactory,
                      IActionResolver actionResolver,
                      IJavaScriptProxyGenerator proxyGenerator,
                      IJsonSerializer jsonSerializer,
                      IHubLocator hubLocator,
                      IHubTypeResolver hubTypeResolver,
                      string url)
     : base(signaler, connectionIdFactory, store, jsonSerializer)
 {
     _hubFactory = hubFactory;
     _store = store;
     _jsonSerializer = jsonSerializer;
     _signaler = signaler;
     _actionResolver = actionResolver;
     _proxyGenerator = proxyGenerator;
     _hubLocator = hubLocator;
     _hubTypeResolver = hubTypeResolver;
     _url = url;
 }
Example #8
0
 public HubDispatcher(IHubFactory hubFactory,
                      IMessageStore store,
                      Signaler signaler,
                      IConnectionIdFactory connectionIdFactory,
                      IActionResolver actionResolver,
                      IJavaScriptProxyGenerator proxyGenerator,
                      IJsonSerializer jsonSerializer,
                      IHubLocator hubLocator,
                      IHubTypeResolver hubTypeResolver,
                      string url)
     : base(signaler, connectionIdFactory, store, jsonSerializer)
 {
     _hubFactory      = hubFactory;
     _store           = store;
     _jsonSerializer  = jsonSerializer;
     _signaler        = signaler;
     _actionResolver  = actionResolver;
     _proxyGenerator  = proxyGenerator;
     _hubLocator      = hubLocator;
     _hubTypeResolver = hubTypeResolver;
     _url             = url;
 }
Example #9
0
 public DefaultJavaScriptProxyGenerator(IHubLocator hubLocator, IJavaScriptMinifier javascriptMinifier)
 {
     _hubLocator         = hubLocator;
     _javascriptMinifier = javascriptMinifier;
 }