J
John J. Hughes II
I have a form with a socket which is handled by the beginReceive function.
When the data is received it is in turn returned to the window for display.
I have done this several times before and the call back is straight forward
enough it just seems the way I am doing it is excessive. I was wondering if
there was a easier way of coding this.
private delegate void SetMessageDelegate(string Message);
private void SetMessage(string Message)
{
this.rtfMessages.AppendText(Message);
}
private void SetMessageHelper(string Message)
{
if(!this.IsDisposed)
this.BeginInvoke(new SetMessageDelegate(this.SetMessage),
new object[] { Message });
}
Regards,
John
When the data is received it is in turn returned to the window for display.
I have done this several times before and the call back is straight forward
enough it just seems the way I am doing it is excessive. I was wondering if
there was a easier way of coding this.
private delegate void SetMessageDelegate(string Message);
private void SetMessage(string Message)
{
this.rtfMessages.AppendText(Message);
}
private void SetMessageHelper(string Message)
{
if(!this.IsDisposed)
this.BeginInvoke(new SetMessageDelegate(this.SetMessage),
new object[] { Message });
}
Regards,
John