Xml and propertygrid Attributes

  • Thread starter Romain TAILLANDIER
  • Start date
R

Romain TAILLANDIER

Hi group,

I have a Parameter class, and i need it to be
XmlSerialisable/XmlDeserialisable, and browsable with a property grid using
custom specification about itself but customising property attribute.

example :

[CategoryAttribute("DataBase"),
DefaultValueAttribute(0),
Description("The datatable name.")]
public string TableDB{get{...}set{...}}

Before i had those three attribute, Xml serialisation works perfectly. Since
i had them, it crash with errors at System.Refletion.Assembly.nLoad(...) in
a dynamically generated Dll (I guess).

If i had the XmlIgnore attribute, it works !

So i deduce that other attribute make crush the xml serialisation.
Why ?
Is there tun arround ? or idea to correct that ?

thanks
ROM
 
R

Romain TAILLANDIER

I found it !!

it was caused by the DefaultValueAttribute.
[CategoryAttribute("DataBase"),
DefaultValueAttribute(""),
Description("The datatable name.")]
public string TableDB{get{...}set{...}}

put 0 in it make the XmlSerializer crush.
Note that the string.empty too, this is a mistery too

thanks group
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top