I'm serializing a class using XmlSerializer. I'm forced to use
XmlSerializer because I'm working on compact framework and this is the
only serialization supported.
When I try to serialize a class with some delegate type member it
gives me an exception saying the member class should have a default
constructor (????). but the member class is a delegate ...
Example:
-----------------------------------------------------
[Serializable]
public static class DelegateContainer
{
public delegate void CustomDelegate(void);
}
[Serializable]
public class ClassToSerialize
{
DelegateContainer.CustomDelegate member = null;
}
------------------------------------------------------
When I serialize ClassToSerialize it gives me an exception saying
CustomDelegate should have a default constructor.
How could I do?
Thank you.
http://msdn2.microsoft.com/en-us/library/system.xml.serialization.xmlattributeev
enthandler(VS.71).aspx
Husam Al-A'araj
> I'm serializing a class using XmlSerializer. I'm forced to use
> XmlSerializer because I'm working on compact framework and this is the
[quoted text clipped - 23 lines]
> How could I do?
> Thank you.
Beorne - 14 May 2007 09:09 GMT
On 11 Mag, 18:27, Husam Al-A''araj
<HusamAlAa...@discussions.microsoft.com> wrote:
> http://msdn2.microsoft.com/en-us/library/system.xml.serialization.xml...
>
[quoted text clipped - 27 lines]
> > How could I do?
> > Thank you.
Sorry, I haven't understood how to use XmlAttributeEventHandler to
serialize a delegate.