/// <summary>
        /// Create a control contains all elements in the frame page, e.g. header, navigation bar, working area and footer. 
        /// The method will be invoked by <see cref="RapidWebDev.UI.Services.FramePageHandler"/> in the event "OnInit".
        /// </summary>
        /// <param name="configurationSection">Frame page configuration section.</param>
        /// <param name="headerPanel">Page header panel.</param>
        /// <param name="footerPanel">Page footer panel.</param>
        /// <param name="siteMapItems">Sitemap items</param>
        /// <returns></returns>
        public Control CreateControl(FramePageConfigurationSection configurationSection, Panel headerPanel, Panel footerPanel, IEnumerable<ISiteMapItem> siteMapItems)
        {
            this.configurationSection = configurationSection;
            this.headerPanel = headerPanel;
            this.footerPanel = footerPanel;

            PlaceHolder placeHolder = new PlaceHolder();

            if (headerPanel != null)
                placeHolder.Controls.Add(this.headerPanel);

            this.CreateNavigationPanels(placeHolder, siteMapItems);

            if (footerPanel != null)
                placeHolder.Controls.Add(this.footerPanel);

            return placeHolder;
        }
        /// <summary>
        /// Create a control contains all elements in the frame page, e.g. header, navigation bar, working area and footer. 
        /// The method will be invoked by <see cref="RapidWebDev.UI.Services.FramePageHandler"/> in the event "OnInit".
        /// </summary>
        /// <param name="configurationSection">Frame page configuration section.</param>
        /// <param name="headerPanel">Page header panel.</param>
        /// <param name="footerPanel">Page footer panel.</param>
        /// <param name="siteMapItems">Sitemap items</param>
        /// <returns></returns>
        public Control CreateControl(FramePageConfigurationSection configurationSection, Panel headerPanel, Panel footerPanel, IEnumerable<ISiteMapItem> siteMapItems)
        {
            this.configurationSection = configurationSection;
            this.headerPanel = headerPanel;
            this.footerPanel = footerPanel;
            this.siteMapItems = siteMapItems;

            PlaceHolder placeHolder = new PlaceHolder();

            if (headerPanel != null)
                placeHolder.Controls.Add(this.headerPanel);

            this.menuPanel = new Panel { ID = "TopNavigationMenuFramePageLayout", CssClass = "TopNavigationMenuFramePageLayout" };
            placeHolder.Controls.Add(this.menuPanel);

            if (footerPanel != null)
                placeHolder.Controls.Add(this.footerPanel);

            return placeHolder;
        }
コード例 #3
0
 /// <summary>
 /// Create a control contains all elements in the frame page, e.g. header, navigation bar, working area and footer. 
 /// The method will be invoked by <see cref="RapidWebDev.UI.Services.FramePageHandler"/> in the event "OnInit".
 /// </summary>
 /// <param name="configurationSection">Frame page configuration section.</param>
 /// <param name="headerPanel">Page header panel.</param>
 /// <param name="footerPanel">Page footer panel.</param>
 /// <param name="siteMapItems">Sitemap items</param>
 /// <returns></returns>
 public Control CreateControl(FramePageConfigurationSection configurationSection, Panel headerPanel, Panel footerPanel, IEnumerable<RapidWebDev.UI.ISiteMapItem> siteMapItems)
 {
     return this.compositeFramePageLayout.CreateControl(configurationSection, headerPanel, footerPanel, siteMapItems);
 }
コード例 #4
0
        /// <summary>
        /// The method is working on validating the permission and authentication of user to the page.
        /// </summary>
        private void Initialize()
        {
            this.configurationSection = ConfigurationManager.GetSection("framePage") as FramePageConfigurationSection;

            this.applicationContext = SpringContext.Current.GetObject<IApplicationContext>();
            this.permissionBridge = SpringContext.Current.GetObject<IPermissionBridge>();

            if (this.configurationSection == null)
                throw new InternalServerErrorException(@"The configuration section ""framePage"" is not found in application configuration file.");

            if (!this.permissionBridge.HasPermission(this.configurationSection.PermissionValue))
                throw new UnauthorizedException(string.Format(CultureInfo.InvariantCulture, @"The user doesn't have the permission to access the frame page with permission value ""{0}"".", this.configurationSection.PermissionValue));
        }