Example #1
0
        /// <summary>
        /// Called when page is retrieved.
        /// </summary>
        /// <param name="renderPageData">The rendering page data.</param>
        /// <param name="pageData">The page data.</param>
        public PageRetrievedEventResult OnPageRetrieved(RenderPageViewModel renderPageData, IPage pageData)
        {
            if (PageRetrieved != null)
            {
                var args = new PageRetrievedEventArgs(renderPageData, pageData);
                PageRetrieved(args);
                return args.EventResult;
            }

            return PageRetrievedEventResult.None;
        }
Example #2
0
        /// <summary>
        /// Called when page is retrieved.
        /// </summary>
        /// <param name="renderPageData">The rendering page data.</param>
        /// <param name="pageData">The page data.</param>
        public PageRetrievedEventResult OnPageRetrieved(RenderPageViewModel renderPageData, IPage pageData)
        {
            if (PageRetrieved != null)
            {
                var args = new PageRetrievedEventArgs(renderPageData, pageData);
                PageRetrieved(args);
                return(args.EventResult);
            }

            return(PageRetrievedEventResult.None);
        }
Example #3
0
        /// <summary>
        /// Occurs, when the page is retrieved.
        /// </summary>
        /// <param name="args">The <see cref="PageRetrievedEventArgs" /> instance containing the event data.</param>
        private void Events_PageRetrieved(PageRetrievedEventArgs args)
        {
            if (args == null || args.RenderPageData == null)
            {
                return;
            }

            args.RenderPageData.ExtendWithBlogData(args.PageData);

            if (!args.RenderPageData.IsBlogPost())
            {
                return; // Default handling.
            }

            if (args.RenderPageData.CanManageContent)
            {
                return; // Default handling.
            }

            if (args.RenderPageData.Status != PageStatus.Published)
            {
                return; // Default handling.
            }

            if (args.RenderPageData.Contents.Any(projection => projection.PageContentStatus != ContentStatus.Published))
            {
                return; // Default handling.
            }

            if (!args.RenderPageData.IsBlogPostActive())
            {
                args.EventResult = PageRetrievedEventResult.ForcePageNotFound;
            }
        }
Example #4
0
 /// <summary>
 /// Occurs, when the page is retrieved.
 /// </summary>
 /// <param name="args">The <see cref="PageRetrievedEventArgs" /> instance containing the event data.</param>
 private void Events_PageRetrieved(PageRetrievedEventArgs args)
 {
     if (args != null && args.RenderPageData != null)
     {
         args.RenderPageData.ExtendWithBlogData(args.PageData);
         if (args.RenderPageData.IsBlogPost() && !args.RenderPageData.IsBlogPostActive() && !args.RenderPageData.CanManageContent)
         {
             args.EventResult = PageRetrievedEventResult.ForcePageNotFound;
         }
     }
 }
 /// <summary>
 /// Occurs, when the page is retrieved.
 /// </summary>
 /// <param name="args">The <see cref="PageRetrievedEventArgs" /> instance containing the event data.</param>
 private void Events_PageRetrieved(PageRetrievedEventArgs args)
 {
     if (args != null && args.RenderPageData != null)
     {
         args.RenderPageData.ExtendWithPageData(args.PageData);
     }
 }