KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I need to avoid serializing an Event class member because when the event is handled by an object that is not marked as Serializable the serialization will fail. I tried using the NonSerialized attribute on the Event class member but it fails to compile. This line of code: <NonSerialized()> Public Event PropertyValueChanged() produces the following error: Attribute 'NonSerializedAttribute' cannot be applied to 'PropertyValueChanged' because the attribute is not valid on this declaration type. Public Event PropertyValueChanged() ' compiles but needs the extra handling described below Is there another way to avoid serializing Event members? This is not a problem if the event is not handled and I can work around it by cloning the objects (and ignoring the event) before serializing them. Just wondering if there is a better way. Thanks.
Tags (comma-separated)
Save Edits
Cancel