Click here to Skip to main content
15,886,077 members
Home / Discussions / C#
   

C#

 
GeneralRe: Stuck on delegates / events Pin
jxfdasilva17-Dec-13 13:21
jxfdasilva17-Dec-13 13:21 
GeneralRe: Stuck on delegates / events Pin
Freak3017-Dec-13 23:17
Freak3017-Dec-13 23:17 
AnswerRe: Stuck on delegates / events Pin
BillWoodruff17-Dec-13 11:40
professionalBillWoodruff17-Dec-13 11:40 
GeneralRe: Stuck on delegates / events Pin
jxfdasilva17-Dec-13 12:23
jxfdasilva17-Dec-13 12:23 
GeneralRe: Stuck on delegates / events Pin
BillWoodruff17-Dec-13 13:10
professionalBillWoodruff17-Dec-13 13:10 
AnswerRe: Stuck on delegates / events Pin
V.17-Dec-13 22:37
professionalV.17-Dec-13 22:37 
GeneralRe: Stuck on delegates / events Pin
jxfdasilva17-Dec-13 22:53
jxfdasilva17-Dec-13 22:53 
GeneralRe: Stuck on delegates / events Pin
V.17-Dec-13 23:09
professionalV.17-Dec-13 23:09 
I'm still not sure how your setup is.
But in Form 2 you set some info (like serial port), how does Form 1 know about it?

You say yourself in a) Putting everything in one class works. I think you might have an NmeaInterpreter instance in form1 and another (different) one in form2

Here's what you should do:
1. Write a wrapper for the NmeaInterpreter class.
2. create delegates/events in that wrapper like "info_received" or something.
3. Setup the properties like serial port, etc in form 2 and pass it to the wrapper.
4. The wrapper should receive the message. in the handler, fire the event made in step 2.
5. make sure form 1 is subscribed to the event "info_received".
Note: depending on how the delegate/event is created you can get the latitude/longitude information. I prefer events with no arguments and just setting the properties before firing the event in the wrapper. When the handler from form 1 launches it just reads out the properties of the wrapper class.

I would encourage you to use the wrapper method, because that will be the single point of entry for your project concerning the third party library (the NmeaInterpreter)

If this does not answer your question, try to go back to your original post and try to rephrase the actual problem and what your trying to achieve. It is very hard for us to understand.

GeneralRe: Stuck on delegates / events Pin
jxfdasilva18-Dec-13 0:51
jxfdasilva18-Dec-13 0:51 
AnswerRe: Stuck on delegates / events Pin
jxfdasilva18-Dec-13 9:10
jxfdasilva18-Dec-13 9:10 
Questionmenu strip in right side Pin
An@nd Rajan1016-Dec-13 20:14
professionalAn@nd Rajan1016-Dec-13 20:14 
AnswerRe: menu strip in right side Pin
Mycroft Holmes16-Dec-13 20:56
professionalMycroft Holmes16-Dec-13 20:56 
GeneralRe: menu strip in right side Pin
An@nd Rajan1016-Dec-13 21:01
professionalAn@nd Rajan1016-Dec-13 21:01 
AnswerRe: menu strip in right side Pin
lukeer16-Dec-13 21:19
lukeer16-Dec-13 21:19 
AnswerRe: menu strip in right side Pin
HobbyProggy17-Dec-13 4:59
professionalHobbyProggy17-Dec-13 4:59 
QuestionDesign pattern Pin
jeenamary16-Dec-13 19:33
jeenamary16-Dec-13 19:33 
JokeRe: Design pattern Pin
Mycroft Holmes16-Dec-13 20:54
professionalMycroft Holmes16-Dec-13 20:54 
AnswerRe: Design pattern Pin
Marco Bertschi17-Dec-13 0:09
protectorMarco Bertschi17-Dec-13 0:09 
AnswerRe: Design pattern Pin
BobJanova17-Dec-13 1:35
BobJanova17-Dec-13 1:35 
AnswerRe: Design pattern Pin
PIEBALDconsult17-Dec-13 3:18
mvePIEBALDconsult17-Dec-13 3:18 
AnswerRe: Design pattern Pin
Abhinav S17-Dec-13 6:25
Abhinav S17-Dec-13 6:25 
QuestionMulticast delegate vs binding Pin
Jörgen Andersson16-Dec-13 5:01
professionalJörgen Andersson16-Dec-13 5:01 
AnswerRe: Multicast delegate vs binding Pin
Abhinav S16-Dec-13 16:06
Abhinav S16-Dec-13 16:06 
AnswerRe: Multicast delegate vs binding Pin
BobJanova17-Dec-13 1:56
BobJanova17-Dec-13 1:56 
GeneralRe: Multicast delegate vs binding Pin
Jörgen Andersson17-Dec-13 3:45
professionalJörgen Andersson17-Dec-13 3:45 

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.