コード例 #1
0
        /// <summary>
        /// Processes the specified arguments.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public void Process(GetRenderingsArgs args)
        {
            if (args == null)
            {
                throw new ArgumentNullException(nameof(args));
            }

            args.Result = args.Result?.Where(r =>
                                             r.DeviceId == args.PageContext.Device.Id &&
                                             !r.IsLayoutRendering() &&
                                             !string.IsNullOrEmpty(r.Placeholder) &&
                                             r.Renderer != null);
        }
        /// <summary>
        ///     Processes the specified arguments.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public void Process(GetRenderingsArgs args)
        {
            if (args == null)
            {
                throw new ArgumentNullException(nameof(args));
            }

            if (args.Result != null)
            {
                return;
            }
            args.Result = args.PageContext.PageDefinition.Renderings;
        }
コード例 #3
0
        /// <summary>
        ///     Processes the specified arguments.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public void Process(GetRenderingsArgs args)
        {
            if (args == null)
            {
                throw new ArgumentNullException(nameof(args));
            }

            Sitecore.Context.Site.SetDisplayMode(DisplayMode.Normal, DisplayModeDuration.ResetAfterRequest);
            CorePipeline.Run("mvc.requestBegin", args);
            if (args.PageContext != null)
            {
                args.PageContext.Item = Sitecore.Context.Item ?? args.PageContext.Item;
            }
        }