public static BehaviorChain ChainForType(Type type)
        {
            if (type.HasAttribute <UrlPatternAttribute>())
            {
                var route = type.GetAttribute <UrlPatternAttribute>().BuildRoute(type);
                return(new RoutedChain(route, type, type));
            }
            var chain = BehaviorChain.ForResource(type);

            chain.IsPartialOnly = true;

            return(chain);
        }
Esempio n. 2
0
        private BehaviorChain buildChainForView(IViewToken view)
        {
            BehaviorChain chain = null;


            if (view.ViewModel.HasAttribute <UrlPatternAttribute>())
            {
                var route = view.ViewModel.GetAttribute <UrlPatternAttribute>().BuildRoute(view.ViewModel);
                chain = new RoutedChain(route, view.ViewModel, view.ViewModel);
            }
            else
            {
                chain = BehaviorChain.ForResource(view.ViewModel);
            }

            chain.Tags.Add("ActionlessView");
            chain.UrlCategory.Category = Categories.VIEW;
            return(chain);
        }