Exemplo n.º 1
0
        private void Parse(byte[] bytes, TcpClient tcpClient)
        {
            if (bytes.Length >= CommandHeader.GetLenght())
            {
                CommandHeader      commandHeader    = CommandHeader.FromBytes(bytes);
                IEnumerable <byte> nextCommandBytes = bytes.Skip(CommandHeader.GetLenght());
                switch ((CommandTypeEnum)commandHeader.Type)
                {
                case CommandTypeEnum.QueryCommand:
                    QueryCommand presentationFileCommand = QueryCommand.FromBytes(nextCommandBytes.ToArray());
                    OnQueryCommand(presentationFileCommand, tcpClient);
                    break;

                case CommandTypeEnum.ClearLogDataGrid:
                    OnClearLogDataGrid(tcpClient);
                    break;
                }
            }
        }