Пример #1
0
        internal static RoutingProvider GetStaticRoutingWithInterfaceRoutingProvider(params object[] processors)
        {
            var router = new RoutingProvider();

            foreach (var processor in processors)
            {
                router.RegisterRoute(new RouteRule(processor, RouteOptions.UseStaticDefaultTemplate()));
                router.RegisterRoute(RouteRule.UseInterfaceMessageHandler(processor));
            }

            return(router);
        }
Пример #2
0
        internal static RoutingProvider GetInterfaceBasedRoutingProvider(params object[] processors)
        {
            var router = new RoutingProvider();

            foreach (var processor in processors)
            {
                router.RegisterRoute(new RouteRule(processor, RouteOptions.UseInterfaceMessageHandler()));
            }
            return(router);
        }
Пример #3
0
        internal static RoutingProvider GetStaticNamesRoutingProvider(params object[] processors)
        {
            var provider = new RoutingProvider();

            foreach (var processor in processors)
            {
                provider.RegisterRoute(new RouteRule(processor, RouteOptions.UseStatic("On{typeName}")));
            }

            return(provider);
        }
Пример #4
0
        public void Foo()
        {
            var m = new MessageDerived();

            var rp = new RoutingProvider();

            rp.RegisterRoute(RouteRule.UseInterfaceMessageHandler(new Handler()));

            //rp.RouteCall<ISessionStarted>(x => x.SessionStarted());
            rp.RouteObject(m);
            rp.RouteObject(11);
            rp.RouteObject(11L);


            //var t = new List<string>();
            //List<object> l= (List<object>)t;
            //rp.RouteObject(new Context(), m);
        }