protected override IValueProvider GetValueProvider(HttpContextBase httpContext, RenderingContext renderingContext)
        {
            if (renderingContext.Rendering.Parameters == null)
            {
                return(null);
            }

            var args = new GetControllerRenderingValueParametersArgs(httpContext, renderingContext);

            var parameters = PipelineService.Get().RunPipeline("mvc.getControllerRenderingValueParameters",
                                                               args,
                                                               x => x.Parameters);

            return(new PipelineValueProvider(parameters ?? new Dictionary <string, object>(), CultureInfo.CurrentCulture));
        }
        public override IValueProvider GetValueProvider(ControllerContext controllerContext)
        {
            if (RenderingContext.CurrentOrNull?.Rendering?.Parameters == null)
            {
                return(null);
            }

            var args = new GetControllerRenderingValueParametersArgs(HttpContext.Current, RenderingContext.Current);

            var parameters = PipelineService.Get().RunPipeline("elision.getControllerRenderingValueParameters",
                                                               args,
                                                               x => x.Parameters);

            return(new PipelineValueProvider(parameters ?? new Dictionary <string, object>(), CultureInfo.CurrentCulture));
        }
Example #3
0
        public AddRenderingParametersTests()
        {
            using (var db = new Db
            {
                new DbItem("page"),
                new DbItem("datasourcefolder")
                {
                    new DbItem("dsitem1"),
                    new DbItem("dsitem2"),
                    new DbItem("dsitem3")
                }
            })
            {
                var processor = new AddRenderingParameters();

                _buildTestRenderingContext = BuildTestRenderingContext(db);
                _resultArgs = new GetControllerRenderingValueParametersArgs(null, _buildTestRenderingContext);

                processor.Process(_resultArgs);
            }
        }