Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / May 2007

Tip: Looking for answers? Try searching our database.

XmlSerializer and delegates

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Beorne - 11 May 2007 16:16 GMT
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.
Husam Al-A''araj - 11 May 2007 17:27 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.