/// <summary>
        /// Creates the actual description.
        /// </summary>
        /// <param name="targetType">Type of the target.</param>
        /// <returns></returns>
        protected virtual IViewModelDescription CreateCore(Type targetType) 
        {
            var customFactory = targetType
                .GetAttributes<IViewModelDescriptionFactory>(true)
                .FirstOrDefault();

            if (customFactory != null)
                return customFactory.Create(targetType);

            var description = new DefaultViewModelDescription(conventionManager, targetType);
            var filters = new FilterManager(targetType, description.TargetType, serviceLocator);
            var actions = actionLocator.Locate(new ActionLocationContext(serviceLocator, targetType, filters));

            description.Filters = filters;
            actions.Apply(description.AddAction);

            return description;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates the actual description.
        /// </summary>
        /// <param name="targetType">Type of the target.</param>
        /// <returns></returns>
        protected virtual IViewModelDescription CreateCore(Type targetType)
        {
            var customFactory = targetType
                                .GetAttributes <IViewModelDescriptionFactory>(true)
                                .FirstOrDefault();

            if (customFactory != null)
            {
                return(customFactory.Create(targetType));
            }

            var description = new DefaultViewModelDescription(conventionManager, targetType);
            var filters     = new FilterManager(targetType, description.TargetType, serviceLocator);
            var actions     = actionLocator.Locate(new ActionLocationContext(serviceLocator, targetType, filters));

            description.Filters = filters;
            actions.Apply(description.AddAction);

            return(description);
        }