Click here to Skip to main content
15,915,600 members
Home / Discussions / C#
   

C#

 
GeneralRe: Working with multiple forms Pin
Henry Minute13-May-09 6:38
Henry Minute13-May-09 6:38 
GeneralRe: Working with multiple forms Pin
bwood202014-May-09 9:49
bwood202014-May-09 9:49 
GeneralRe: Working with multiple forms Pin
Henry Minute14-May-09 10:46
Henry Minute14-May-09 10:46 
GeneralRe: Working with multiple forms Pin
DaveyM6912-May-09 8:09
professionalDaveyM6912-May-09 8:09 
QuestionI can't get latest value by ref parameter. WHY? [modified] Pin
codeadair12-May-09 5:26
codeadair12-May-09 5:26 
AnswerRe: I can't get latest value by ref parameter. WHY? Pin
Henry Minute12-May-09 5:39
Henry Minute12-May-09 5:39 
GeneralRe: I can't get latest value by ref parameter. WHY? Pin
codeadair12-May-09 14:57
codeadair12-May-09 14:57 
QuestionSeveral event handlers, one handler function, how to know which event handler has been used?? Pin
blackhattrick12-May-09 5:23
blackhattrick12-May-09 5:23 
I have a serial ports list. I declared it like this:

<br />
private List<SerialPort> lstSerialPorts;<br />
<br />
for (int i = 1; i<=cont; i++)<br />
{<br />
    SerialPort tempPort = new SerialPort("COM" + cont.ToString(), 2400);<br />
    lstSerialPorts.Add(tempPort);<br />
    lstSerialPörts[i].DataReceived += SerialDataReceivedEventHandler(TEST_FUNCTION);<br />
}<br />


My TEST_FUNCTION is empty so far:

<br />
<br />
void TEST_FUNCTION(object sender, SerialDataReceivedEventArgs e)<br />
{<br />
            throw new NotImplementedException();<br />
}<br />


As you can see, all serial ports have the same handler function. How could I check which serial port triggered the TEST_FUNCTION? It would be great something like this:

<br />
void TEST_FUNCTION(object sender, SerialDataReceivedEventArgs e)<br />
{<br />
      Console.WriteLine("This function was triggered by: {0}",anUnknownVariable);<br />
}<br />


Parameter "e" does not have any useful property or function

Any help would be apreciated and excuse me about my English if I made a mistake Smile | :)

Ivan
AnswerRe: Several event handlers, one handler function, how to know which event handler has been used?? Pin
DaveyM6912-May-09 5:29
professionalDaveyM6912-May-09 5:29 
AnswerRe: Several event handlers, one handler function, how to know which event handler has been used?? Pin
Samer Aburabie12-May-09 5:32
Samer Aburabie12-May-09 5:32 
AnswerRe: Several event handlers, one handler function, how to know which event handler has been used?? Pin
OriginalGriff12-May-09 5:34
mveOriginalGriff12-May-09 5:34 
AnswerRe: Several event handlers, one handler function, how to know which event handler has been used?? Pin
blackhattrick12-May-09 5:53
blackhattrick12-May-09 5:53 
GeneralRe: Several event handlers, one handler function, how to know which event handler has been used?? Pin
riced12-May-09 7:43
riced12-May-09 7:43 
GeneralRe: Several event handlers, one handler function, how to know which event handler has been used?? Pin
blackhattrick12-May-09 15:24
blackhattrick12-May-09 15:24 
QuestionProgramatically download file (script problem) Pin
Niemand2512-May-09 5:13
professionalNiemand2512-May-09 5:13 
QuestionHELP with assignment Pin
sofi7912-May-09 5:00
sofi7912-May-09 5:00 
AnswerRe: HELP with assignment Pin
EliottA12-May-09 5:09
EliottA12-May-09 5:09 
AnswerRe: HELP with assignment Pin
sofi7912-May-09 5:14
sofi7912-May-09 5:14 
GeneralRe: HELP with assignment Pin
DaveyM6912-May-09 5:20
professionalDaveyM6912-May-09 5:20 
GeneralRe: HELP with assignment Pin
PIEBALDconsult12-May-09 5:25
mvePIEBALDconsult12-May-09 5:25 
GeneralRe: HELP with assignment Pin
Dan Neely12-May-09 6:00
Dan Neely12-May-09 6:00 
GeneralRe: HELP with assignment Pin
PIEBALDconsult12-May-09 7:03
mvePIEBALDconsult12-May-09 7:03 
GeneralRe: HELP with assignment Pin
Dan Neely12-May-09 7:08
Dan Neely12-May-09 7:08 
GeneralRe: HELP with assignment Pin
PIEBALDconsult12-May-09 7:14
mvePIEBALDconsult12-May-09 7:14 
GeneralRe: HELP with assignment Pin
Dan Neely12-May-09 8:27
Dan Neely12-May-09 8:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.