Ejemplo n.º 1
0
        public override object GetResult(ValueProviderArgs args)
        {
            var renderingContext = RenderingContext.CurrentOrNull;

            //stop if we have no rendering context or we have no datasource for the current rendering
            if (string.IsNullOrEmpty(renderingContext?.Rendering.DataSource))
            {
                return(null);
            }

            return(renderingContext.Rendering.Item);
        }
        public override void Process(ValueProviderArgs args)
        {
            //make sure we're all good
            Assert.IsNotNull(args, typeof(ValueProviderArgs));

            //stop if we cannot serve the requested type
            if (args.RequestedType != typeof(T))
            {
                return;
            }

            base.Process(args);
        }
        public virtual void Process(ValueProviderArgs args)
        {
            //make sure we're all good
            Assert.IsNotNull(args, typeof(ValueProviderArgs));

            //stop if we already have a result
            if (args.Result != null)
            {
                return;
            }

            //get the result
            args.Result = GetResult(args);

            //abort if result was succesfully retrieved
            if (args.Result != null)
            {
                args.AbortPipeline();
            }
        }
 public override object GetResult(ValueProviderArgs args)
 {
     return(RenderingContext.CurrentOrNull?.Rendering.Parameters);
 }
 public abstract object GetResult(ValueProviderArgs args);
Ejemplo n.º 6
0
 public override object GetResult(ValueProviderArgs args)
 {
     return(Sitecore.Context.Item);
 }