473,379 Members | 1,201 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Serialization of types that contain events

Hi All

If I have a type that contains an event, then serialization tries to
serialize the delegate and its invocation list - not good.

In C#, I can write code like this (follows) - note the use of the
NonSerialized attribute with the field qualifier [field:NonSerialized].
Without the field qualifier I get a compile time error.

In VB.NET, I don't seem to have an equivalent - I can't do
<Field:NonSerialized()> - which means I can't work around this serialization
problem. Is there a workaround?

Nigel

public class Bla
{
[field:NonSerialized]
public event MyEventHandler MyEvent;
}

public delegate void MyEventHandler(Object sender, MyEventArgs e);

public class MyEventArgs : System.EventArgs
{
}
Nov 21 '05 #1
0 918

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ayende Rahien | last post by:
Is it possible to use events as a communication mechanism between threads?
0
by: Efim | last post by:
Hi, I have got some problem with sending of events in .NET. I am using remouting. The client has got 2 objects for receiving different types of events (responses and events) The server has got...
2
by: glenn | last post by:
I have a very serious problem with my forms and components that I was wondering if there was a way to turn off. The problem is as follows: 1) create a form and place 50 components on the form...
4
by: Javier Ros | last post by:
hi guys, I donīt see a Click Event or DblClick Event, how to implement code for this events? Is it posible? (if not) how to do a fake? hmn... in the last order ... javascript? Thanks.
0
by: Nigel Armstrong | last post by:
Hi All If I have a type that contains an event, then serialization tries to serialize the delegate and its invocation list - not good. In C#, I can write code like this (follows) - note the...
6
by: John Glover | last post by:
I'm having a very strange problem with XML serialization. I'm writing web services which pass instances of various classes back and forth as parameters and return values of web methods. The...
7
by: nick.fletcher | last post by:
I have a custom collection which derives from Collection<which stores a number of objects. Before each item is added to the collection - an event which it exposes is hooked by the collection and...
4
by: rhino | last post by:
I've been looking at the information on Structured Types in the certifcation guide and have previously read it in the DB2 manuals. As neat as Structured Types are, I'm very curious to know if they...
1
by: Rodrigo Defavari | last post by:
Hello People ! I need to direction all control events of a form to the function that will be responsible for treating them, but I won't this function be added to the handler of each control...
2
by: puzzlecracker | last post by:
I want interface, that in addition to providing methods declarion, also contain events: interface Connection{ public event MyDelegateHandler handler; public event MyDelegateHandler2...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.