/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnSocketEventRaised(object sender, EventArgCollection.SocketEventArgs e) { Console.WriteLine(e.Msg); if (this.window != null) { this.window.OnMessageReceived(e.Msg); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void listener_OnSocketEventRaised(object sender, EventArgCollection.SocketEventArgs e) { if (this.window != null) { this.window.MessageCallBackMethod(e.Msg, null); if (!string.IsNullOrEmpty(e.ClientName)) { this.window.ServersCallBackMethod(e); } } }
/// <summary> /// ServersCallBackMethod /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void ServersCallBackMethod(EventArgCollection.SocketEventArgs e) { Tev_Clients.Invoke(new Action(() => { Tev_Clients.BeginUpdate(); if (e.IsConnect) { Tev_Clients.Nodes.Add(e.ClientName, e.ClientName); } else { Tev_Clients.Nodes.RemoveByKey(e.ClientName); } Tev_Clients.EndUpdate(); })); }