private void Server_ProtocolPackEvent(object sender, MES_Controls.MES_Protocol.ProtocolPackEventArgs e) { // throw new NotImplementedException(); MES_Controls.MES_Protocol.ProtocolPack protocolPack = e.protocolPack; string text = Encoding.Default.GetString(protocolPack.Bytes); // this.richTextBox1.Invoke(new Action(() => { this.richTextBox1.AppendText(text + '\r'); })); }
private void ParseAccpetData(byte[] recBuffer, int length, Client_Hash client_Hash) { // throw new NotImplementedException(); ProtocolPack protocolPack = new ProtocolPack(); protocolPack.Bytes = new byte[length]; Array.Copy(recBuffer, protocolPack.Bytes, length); protocolPack.Client = client_Hash; ProtocolPackEvent(this, new ProtocolPackEventArgs(protocolPack)); }
private void Mes_Server_ProtocolPackEvent(object sender, ProtocolPackEventArgs e) { MES_Controls.MES_Protocol.ProtocolPack protocolPack = e.protocolPack; string text = Encoding.Default.GetString(protocolPack.Bytes); //throw new NotImplementedException(); this.richTextBox1.Invoke(new Action(() => { this.richTextBox1.SelectionAlignment = HorizontalAlignment.Left; this.richTextBox1.AppendText(DateTime.Now + ":" + text + '\r'); })); }
public ProtocolPackEventArgs(ProtocolPack protocolPack) { this.protocolPack = protocolPack; }