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 }); }
public void ErrorResponseHandler(ServerResponseInformation serverResponse, string command) { Console.WriteLine(DateTime.Now.ToString()); Console.WriteLine("Error of " + command + " command"); }
public void BadLoginResponseHandler(ServerResponseInformation serverResponse, string command) { _clientMediator.UnAuthrorize(); Console.WriteLine(serverResponse.SerializedData); }
public void SuccessResponseHandler(ServerResponseInformation serverResponse, string command) { Console.WriteLine(DateTime.Now.ToString()); Console.WriteLine("Success handle of command" + command + "."); }
public void TestResponseHandler(ServerResponseInformation serverResponse, string command) { Console.WriteLine(serverResponse.Status); Console.WriteLine(serverResponse.SerializedData); }