Andy_P
Jul 5th, 2007, 03:30 PM
I have a class that is reading a block of data from a serial port, approx 800 bytes, does some stuff with it and ends up with an integer array.
I want to have an event that fires when the data has been collected to present it to the rest of the app. It occurs to me I could do it a couple of ways:
1. Have the data as a field of a derived EventArgs class so that it can be read directly in the event handler...
or
2. Have the event fire to indicate nothing more than 'Data is ready', and then read the data from a class property.
I would like any opinions on which would be the better method, if either, or if there is a better way to do it than my ideas.
Thank you!
I want to have an event that fires when the data has been collected to present it to the rest of the app. It occurs to me I could do it a couple of ways:
1. Have the data as a field of a derived EventArgs class so that it can be read directly in the event handler...
or
2. Have the event fire to indicate nothing more than 'Data is ready', and then read the data from a class property.
I would like any opinions on which would be the better method, if either, or if there is a better way to do it than my ideas.
Thank you!