/*[NonSerialized()]*/ public event ListEvent ListChangedEx = null;

  • Thread starter Thread starter Alexander Muylaert
  • Start date Start date
A

Alexander Muylaert

How can I prevent an event of beïng serialized? it always give me the error

Attribute nonserialized is not valid on this declaration type ...

Kind regards

Alexander
 
Hi Alexander,

You can't apply this attribute directly to an event. You have to applied to
the even's back-up field

class Foo
{
[field: NonSerialized]
public event AnEventHandler AnEvent;
}
 

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

Back
Top