[Mono-dev] System.ComponentModel.PropertyDescriptor does not show attributes on an overridden property

Michael Hutchinson m.j.hutchinson at gmail.com
Thu Aug 11 08:50:35 EDT 2005


Hello,

I have found a bug where the Attributes collection provided by
System.ComponentModel.PropertyDescriptor does not show attributes on
an overridden property.

Test case:
*************

using System.ComponentModel;
using System;

class Test
{
	static void Main()
	{
		foreach (PropertyDescriptor pd in TypeDescriptor.GetProperties (new
OverridingClass ()))
			foreach (Attribute att in pd.Attributes)
				Console.WriteLine (att.GetType ().ToString ());
	}
	
	class BaseClass
	{
		[Browsable (false)]
		public virtual bool Test {
			get { return true; }
		}		
	}
	
	class OverridingClass : BaseClass
	{
		public override bool Test {
			get { return base.Test; }
		}
	}	
}

*************

On. .NET 1.1 SP1 we get the output:

System.ComponentModel.ReadOnlyAttribute

System.CLSCompliantAttribute

System.ComponentModel.BrowsableAttribute

But on Mono we get nothing.



More information about the Mono-devel-list mailing list