Beispiel #1
0
        public override void AppendSubBuilder(ControlBuilder subBuilder)
        {
            Type controlType = subBuilder.ControlType;

            if (!typeof(Control).IsAssignableFrom(controlType))
            {
                throw new HttpException(System.Web.SR.GetString("Page_theme_only_controls_allowed", new object[] { (controlType == null) ? string.Empty : controlType.ToString() }));
            }
            if (base.InPageTheme && !ThemeableAttribute.IsTypeThemeable(subBuilder.ControlType))
            {
                throw new HttpParseException(System.Web.SR.GetString("Type_theme_disabled", new object[] { subBuilder.ControlType.FullName }), null, subBuilder.VirtualPath, null, subBuilder.Line);
            }
            base.AppendSubBuilder(subBuilder);
        }
Beispiel #2
0
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public override void AppendSubBuilder(ControlBuilder subBuilder)
        {
            // Only allow controls at theme top level
            Type ctrlType = subBuilder.ControlType;

            if (!typeof(Control).IsAssignableFrom(ctrlType))
            {
                throw new HttpException(SR.GetString(SR.Page_theme_only_controls_allowed, ctrlType == null ?
                                                     String.Empty : ctrlType.ToString()));
            }

            // Check if the control theme type is themeable.
            if (InPageTheme && !ThemeableAttribute.IsTypeThemeable(subBuilder.ControlType))
            {
                throw new HttpParseException(SR.GetString(SR.Type_theme_disabled, subBuilder.ControlType.FullName),
                                             null, subBuilder.VirtualPath, null, subBuilder.Line);
            }

            base.AppendSubBuilder(subBuilder);
        }