public ServerResponseDTO HandleCommand(ClientCommandDTO clientCommand)
        {
            MethodInfo handleMethod = SearchHandleMethod(_handleclass, clientCommand.Command);

            if (handleMethod == null)
            {
                throw new ServerCommandHandleException("Undefined command");
            }
            ServerResponseInformation serverResponseInformation
                = (ServerResponseInformation)handleMethod.Invoke(this, new object[] {
                clientCommand.Information
            });

            return(new ServerResponseDTO
            {
                IdCommand = clientCommand.IdCommand,
                Command = clientCommand.Command,
                Information = serverResponseInformation
            });
        }
Пример #2
0
 public void ErrorResponseHandler(ServerResponseInformation serverResponse, string command)
 {
     Console.WriteLine(DateTime.Now.ToString());
     Console.WriteLine("Error of " + command + " command");
 }
Пример #3
0
 public void BadLoginResponseHandler(ServerResponseInformation serverResponse, string command)
 {
     _clientMediator.UnAuthrorize();
     Console.WriteLine(serverResponse.SerializedData);
 }
Пример #4
0
 public void SuccessResponseHandler(ServerResponseInformation serverResponse, string command)
 {
     Console.WriteLine(DateTime.Now.ToString());
     Console.WriteLine("Success handle of command" + command + ".");
 }
Пример #5
0
 public void TestResponseHandler(ServerResponseInformation serverResponse, string command)
 {
     Console.WriteLine(serverResponse.Status);
     Console.WriteLine(serverResponse.SerializedData);
 }