private void connection_OnUIMessage(object sender, EventArgs e)
 {
     if (e is TCPConnectionEventArgs)
     {
         TCPConnectionEventArgs foo = e as TCPConnectionEventArgs;
         Dispatcher.BeginInvoke(new Handler(SetText), foo.info);
     }
 }
 public void OnMessageReceived(TCPConnectionEventArgs e)
 {
     MessageReceived?.Invoke(this, e);
 }
 public void OnUIMessage(TCPConnectionEventArgs e)
 {
     UIMessage?.Invoke(this, e);
 }