|
-
October 14th, 2008, 03:35 PM
#3
Re: Decoupling GUI from logic question
Your logic should be in a separate class. Implement an event on your class which the GUI hooks into.
e.g.
Code:
public class SerialPortLogic
{
public delegate void MessageReceivedHandler(object sender, byte [] data);
public event MessageReceivedHandler MessageReceived;
}
There's a tutorial on custom events here : http://msdn.microsoft.com/en-us/libr...39(VS.71).aspx.
Darwen.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|