pigeonrandle <(E-Mail Removed)> wrote:
> Hi,
> I have a couple of forms on my client application that use an
> asyncronous tcp client to send and recieve data from a server
> application.
> On each of these forms, i have a Listbox which i would like to add
> status information to, like,
>
> "Connected to server"
> "Details Sent"
> "Details Received"
>
> Is it possible to have my forms implement an interface that includes a
> generic delegate such as
>
> "void AddStatusString(String s)"
>
> where i pass the message s from the tcp client to my form's listbox?
>
> This is sending me a bit screwy because i cant get my head around
> exactly what needs to be in the interface. I know it can't be "void
> AddStatusString(String s)" because this is the function in my form that
> is Invoked BY a delegate, if you get my meaning.
I'm not sure I see why a delegate is needed. If you implement the
interface, you just write a method AddStatusString which is implemented
by adding the given string to the listbox - why do you need delegates?
--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too