Пример #1
0
 public static IEnumerable <IViewEngine> ThatApplyTo(
     this IEnumerable <IViewEngine> viewEngines,
     ActionDescriptor actionDescriptor, Configuration configuration,
     ViewConfiguration viewConfiguration, HttpConfiguration httpConfiguration)
 {
     return(viewConfiguration.ViewEngines.ThatAppliesTo(viewEngines,
                                                        new ActionConfigurationContext(configuration, httpConfiguration,
                                                                                       actionDescriptor.Action, actionDescriptor.Route),
                                                        new ViewEngineContext(actionDescriptor)));
 }
Пример #2
0
 public static IEnumerable <IViewSource> ThatApplyTo(
     this IEnumerable <IViewSource> viewSources, string[] supportedTypes,
     ActionDescriptor actionDescriptor, Configuration configuration,
     ViewConfiguration viewConfiguration, HttpConfiguration httpConfiguration)
 {
     return(viewConfiguration.ViewSources.ThatAppliesTo(viewSources,
                                                        new ActionConfigurationContext(configuration, httpConfiguration,
                                                                                       actionDescriptor.Action, actionDescriptor.Route),
                                                        new ViewSourceContext(actionDescriptor, supportedTypes)));
 }
Пример #3
0
 public ViewDecorator(List <IViewSource> viewSources,
                      ViewConfiguration viewConfiguration,
                      List <IViewEngine> viewEngines,
                      Configuration configuration,
                      HttpConfiguration httpConfiguration)
 {
     _viewSources       = viewSources;
     _viewConfiguration = viewConfiguration;
     _viewEngines       = viewEngines;
     _configuration     = configuration;
     _httpConfiguration = httpConfiguration;
 }
Пример #4
0
        public static ConfigurationDsl EnableViews(
            this ConfigurationDsl configuration,
            Action <ViewConfigurationDsl> configure = null)
        {
            var viewConfiguration = new ViewConfiguration();

            configure?.Invoke(new ViewConfigurationDsl(viewConfiguration));
            configuration
            .ConfigureActionDecorators(x => x
                                       .Append <ViewDecorator>())
            .ConfigureRegistry(x => x
                               .Register(RazorEngineService.Create(
                                             viewConfiguration.RazorConfiguration))
                               .Register(viewConfiguration)
                               .RegisterPlugins(viewConfiguration.ViewEngines)
                               .RegisterPlugins(viewConfiguration.ViewSources));

            return(configuration);
        }
Пример #5
0
 public ViewConfigurationDsl(ViewConfiguration configuration)
 {
     _configuration = configuration;
 }
Пример #6
0
 public NamespacePathMappingDsl(ViewConfiguration configuration)
 {
     _configuration = configuration;
 }