Exemplo n.º 1
0
 public override bool Equals(object obj)
 {
     if (obj != null && obj is ThemeableAttribute)
     {
         ThemeableAttribute ta = (ThemeableAttribute)obj;
         return(this.themeable == ta.themeable);
     }
     return(false);
 }
Exemplo n.º 2
0
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }
            ThemeableAttribute attribute = obj as ThemeableAttribute;

            return((attribute != null) && (attribute.Themeable == this._themeable));
        }
Exemplo n.º 3
0
        /// <internalonly/>
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }

            ThemeableAttribute other = obj as ThemeableAttribute;

            return((other != null) && (other.Themeable == _themeable));
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
0
        public static bool IsTypeThemeable(Type type)
        {
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }
            object obj2 = _themeableTypes[type];

            if (obj2 == null)
            {
                ThemeableAttribute customAttribute = Attribute.GetCustomAttribute(type, typeof(ThemeableAttribute)) as ThemeableAttribute;
                obj2 = (customAttribute == null) ? ((object)0) : ((object)customAttribute.Themeable);
                _themeableTypes[type] = obj2;
            }
            return((bool)obj2);
        }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
0
        public static bool IsTypeThemeable(Type type)
        {
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }

            object result = _themeableTypes[type];

            if (result != null)
            {
                return((bool)result);
            }

            //System.ComponentModel.AttributeCollection attrs = TypeDescriptor.GetAttributes(type);
            //ThemeableAttribute attr = (ThemeableAttribute)attrs[typeof(ThemeableAttribute)];
            ThemeableAttribute attr = Attribute.GetCustomAttribute(type, typeof(ThemeableAttribute)) as ThemeableAttribute;

            result = (attr != null) && attr.Themeable;
            _themeableTypes[type] = result;

            return((bool)result);
        }