コード例 #1
0
        /// <summary>
        /// Creates a new page content items
        /// </summary>
        /// <param name="pageName">Name of the page</param>
        /// <param name="group">String id of the group the page belongs to. Use this to distinct between a set of pages.</param>
        /// <param name="initializer">Delegate to run immediately after the page item is created</param>
        /// <param name="eventHandler">Page event handler</param>
        public static IContent NewPage(this IContentManager contentManager, string pageName, string group, Action <IContent> initializer, IPageEventHandler eventHandler)
        {
            var page = contentManager.New(contentManager.CreatePageName(pageName, group));

            initializer(page);

            var context = new PageContext(page, group);

            eventHandler.OnPageInitializing(context);
            eventHandler.OnPageInitialized(context);

            return(page);
        }
コード例 #2
0
        /// <summary>
        /// Creates a new dynamic page content item.
        /// </summary>
        /// <param name="pageName">Name of the page</param>
        /// <param name="group">String id of the group the page belongs to. Use this to distinct between a set of pages.</param>
        /// <param name="initializer">Delegate to run immediately after the page item is created</param>
        public static IContent NewPage(this IContentManager contentManager, string pageName, string group)
        {
            var page = contentManager.New(contentManager.CreatePageName(pageName, group));

            return(page);
        }