/// <summary>
        /// All required parameters for the Mvc infrastructure package.
        /// </summary>
        /// <param name="modelAssembly">The model assembly.</param>
        /// <param name="viewAssembly">The view assembly.</param>
        /// <param name="controllerAssembly">The controller assembly.</param>
        /// <param name="applicationTitle">The default title to display in ajax requests when partially rendering a view.</param>
        /// <param name="resourceAssemblies">The location of the different string resources that are rendered client-side.</param>
        /// <param name="filters">A list of default action invoker filters.</param>
        /// <param name="jobAssembly">The assembly containing jobs.</param>
        /// <param name="automapperAssemblies">A list of AutoMapper profile types.</param>
        /// <param name="hubAssembly">The SignalR hub assembly.</param>
        public MvcInstallerParameters(
            Assembly modelAssembly,
            Assembly viewAssembly,
            Assembly controllerAssembly,
            string applicationTitle,
            IList<ResourceAssemblyLocation> resourceAssemblies,
            ActionInvokerFilters filters,
            Assembly jobAssembly,
            Assembly[] automapperAssemblies,
            Assembly hubAssembly)
        {
            Ensure.That(() => modelAssembly).IsNotNull();
            Ensure.That(() => viewAssembly).IsNotNull();
            Ensure.That(() => controllerAssembly).IsNotNull();
            Ensure.That(() => applicationTitle).IsNotNullOrEmpty();
            Ensure.That(() => resourceAssemblies).IsNotNull();
            Ensure.That(() => filters).IsNotNull();
            Ensure.That(() => jobAssembly).IsNotNull();
            Ensure.That(() => filters).IsNotNull();
            Ensure.That(() => automapperAssemblies).IsNotNull();
            Ensure.That(() => hubAssembly).IsNotNull();

            ModelAssembly = modelAssembly;
            ViewAssembly = viewAssembly;
            ControllerAssembly = controllerAssembly;
            ApplicationTitle = applicationTitle;
            ResourceAssemblies = resourceAssemblies;
            Filters = filters;
            JobAssembly = jobAssembly;
            MapperAssemblies = automapperAssemblies;
            HubAssembly = hubAssembly;
        }
        public WindsorActionInvoker(ActionInvokerFilters filters)
        {
            Ensure.That(() => filters).IsNotNull();

            this.filters = filters;
        }
示例#3
0
        private MvcInstallerParameters GetMvcInstallerParameters()
        {
            Assembly modelAssembly = typeof(UserLoginModel).Assembly;
            Assembly controllerAssembly = typeof(HomeController).Assembly;
            ActionInvokerFilters filters = new ActionInvokerFilters();
            Assembly jobAssembly = typeof(FacebookService).Assembly;
            Assembly[] mapperAssemblies = GetMapperAssemblies();
            Assembly hubAssembly = typeof(LogHub).Assembly;

            MvcInstallerParameters parameters = new MvcInstallerParameters
            (
                modelAssembly,
                viewAssembly,
                controllerAssembly,
                applicationTitle,
                resourceAssemblies,
                filters,
                jobAssembly,
                mapperAssemblies,
                hubAssembly
            );
            return parameters;
        }