예제 #1
0
        public DefaultHubTypeResolver(IHubLocator hubLocator)
        {
            if (hubLocator == null)
            {
                throw new ArgumentNullException("hubLocator");
            }

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

            BuildCache(hubLocator);
        }
예제 #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);
 }
예제 #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);
 }
예제 #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);
            }
        }
예제 #6
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);
            }
        }
예제 #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;
 }
예제 #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;
 }
예제 #9
0
 public DefaultJavaScriptProxyGenerator(IHubLocator hubLocator, IJavaScriptMinifier javascriptMinifier)
 {
     _hubLocator         = hubLocator;
     _javascriptMinifier = javascriptMinifier;
 }