views:

44

answers:

0

Hi guys,

I'm trying to use a class both for databinding and for serializing using some custom serialization code.

The problem is that the class has a System.ComponentModel.TypeDescriptionProviderAttribute applied to it:

[SomeSerializingAttribute]
[System.ComponentModel.TypeDescriptionProvider(typeof(RowTypeDescriptionProvider))]
public class Row { /* Stuff*/ }

For whatever reason this makes System.ComponentModel.TypeDescriptor.GetAttributes(Type) return an empty list (rather than the expected list of two attributes). This is even though the 'TypeDescriptionProvider' is only seems to be used when calling: System.ComponentModel.TypeDescriptor.GetAttributes(Object)

I would really prefer to continue using TypeDescriptor rather than direct reflection.

Also: I notice that there is a System.ComponentModel.TypeDescriptor.GetAttributes(Object, Boolean), that prevents the system from using customtypedescriptors. But there doesn't seem to be anything similar for the Type version. See: http://msdn.microsoft.com/en-us/library/system.componentmodel.typedescriptor.getattributes%28VS.80%29.aspx.

Any thoughts?