예제 #1
0
 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'); }));
 }
예제 #2
0
        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));
        }
예제 #3
0
        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');
            }));
        }
예제 #4
0
 public ProtocolPackEventArgs(ProtocolPack protocolPack)
 {
     this.protocolPack = protocolPack;
 }