public static void EnviaMgsAdmin(string mgs) { StreamWriter swsender; e = new StatuEventArgs("Administrador: " + mgs); onChaged(e); TcpClient[] tcpClient = new TcpClient[BatePapo.htUser.Count]; BatePapo.htUser.Values.CopyTo(tcpClient, 0); for (int i = 0; i < tcpClient.Length; i++) { try { if (mgs.Trim() == "" || tcpClient[i] == null) { continue; } swsender = new StreamWriter(tcpClient[i].GetStream()); swsender.WriteLine("Administrador: " + mgs); swsender.Flush(); swsender = null; } catch { RemoveUser(tcpClient[i]); } } }
public static void onChaged(StatuEventArgs e) { StatuEventHandler statuHandles = StatusChanged; if (statuHandles != null) { statuHandles(null, e); } }
public void servidor_StatusChanged(object sender, StatuEventArgs e) { this.Invoke(new AtualizaStatuCall(this.AtualizaStatu), new object[] { e.EventMgs }); }