Example #1
0
 public void OutputMessage(UIOutputModel outputModel)
 {
     lock (consoleLocker){
         Console.WriteLine(outputModel.Title);
         Console.WriteLine(outputModel.OtherInformation);
     }
 }
 public ClientCommandRequest UIInputCommand(UIOutputModel inputModel)
 {
     try
     {
         return(_userInterface.InputCommand(inputModel));
     }
     catch (Exception exception)
     {
         throw new SystemDiagnosticClientException(exception, "Error at user interface.");
     }
 }
 private void Run(UIOutputModel OutputMessage)
 {
     try
     {
         RunInputModel runInputModel = _userInterface.InputRunProperties(OutputMessage);
         _crClient.Run(runInputModel.IPAddress, runInputModel.Port);
         IsRun = true;
         _scheduleCommandManager.Run();
     }
     catch (CRClientException exception)
     {
         Run(new UIOutputModel {
             Title = exception.Message
         });
     }
 }
Example #4
0
        public RunInputModel InputRunProperties(UIOutputModel outputModel)
        {
            bool      ErrorIp = false, ErrorPort = false;
            IPAddress ip;
            int       port;

            lock (consoleLocker){
                do
                {
                    Console.WriteLine(outputModel.Title);
                    Console.WriteLine(outputModel.OtherInformation);
                    Console.WriteLine("Input ip address:");
                    string ipstr = Console.ReadLine();
                    Console.WriteLine("Input port:");
                    string portstr = Console.ReadLine();
                    ErrorIp   = !IPAddress.TryParse(ipstr, out ip);
                    ErrorPort = !int.TryParse(portstr, out port);
                }while(ErrorIp || ErrorPort);
            }
            return(new RunInputModel {
                IPAddress = ip,
                Port = port
            });
        }
Example #5
0
        public ClientLoginModel InputLogin(UIOutputModel outputModel)
        {
            string login;
            string password;
            bool   ErrorLogin = false, ErrorPassword = false;

            lock (consoleLocker){
                do
                {
                    Console.WriteLine(outputModel.Title);
                    Console.WriteLine(outputModel.OtherInformation);
                    Console.WriteLine("Please Input Login:"******"Please Input Password");
                    password      = Console.ReadLine();
                    ErrorLogin    = string.IsNullOrEmpty(login);
                    ErrorPassword = string.IsNullOrWhiteSpace(password);
                }while(ErrorLogin || ErrorPassword);
            }
            return(new ClientLoginModel {
                Login = login,
                Password = password
            });
        }
Example #6
0
 public ClientCommandRequest InputCommand(UIOutputModel outputModel)
 {
     throw new NotImplementedException();
 }
 public void OutputUIMessage(UIOutputModel messageModel)
 {
     _userInterface.OutputMessage(messageModel);
 }