Hi,
I have a custom attribute targing Property:
[AttributeUsage(AttributeTargets.Property, AllowMultiple=false,
Inherited=true)]
public class StatefulPropertyAttribute : Attribute{}
and all the properties marked with [StatefulPropertyAttribute] will be
handled by
public System.ComponentModel.PropertyDescriptorCollection
GetStatefulPropertyDescriptors()
{
return this.GetProperties(new Attribute[]{new
DataObject.StatefulPropertyAttribute()});
}
public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
{
PropertyDescriptorCollection globalizedProps;
PropertyDescriptorCollection baseProps =
TypeDescriptor.GetProperties(this, attributes, true);//bind object
globalizedProps = new PropertyDescriptorCollection(null);
// For each property use a property descriptor of our own that is able to be
globalized
foreach (PropertyDescriptor oProp in baseProps ) //show those
properties
{
if (!this.IsPropertyHidden(oProp.Name))
globalizedProps.Add(new GlobalizedPropertyDescriptor(oProp));
}
return globalizedProps;
}
They will be put into PropertyDescriptorCollection.This works fine under
..Net 1.1. But under .Net 2.0 it somehow does not work as the same way as
..net 1.1, that means those properties not marked with
[StatefulPropertyAttribute] are also put into the
PropertyDescriptorCollection.
So is there any changes ABOUT TypeDescriptor.GetProperties(this, attributes,
true)in .NET 2.0? How to solve this problem?
Thanks.
--
windsim