Example #1
0
 public TerminalController(TerminalApi terminalApi)
 {
     _terminalApi = terminalApi;
 }
Example #2
0
File: Program.cs Project: xcjs/u413
        /// <summary>
        /// Pass the command string to the terminal API for execution, then examine the resulting instructions.
        /// </summary>
        /// <param name="commandString">The command string passed from the command line.</param>
        private static void InvokeCommand(string commandString)
        {
            var kernel = new StandardKernel(new U413Bindings(false));
            _terminalApi = kernel.Get<TerminalApi>();
            _terminalApi.Username = _username;
            _terminalApi.CommandContext = _commandContext;

            var loadingThread = new Thread(ShowLoading);
            loadingThread.Start();

            var commandResult = _terminalApi.ExecuteCommand(commandString);

            loadingThread.Abort();
            loadingThread.Join();

            InterpretResult(commandResult);
        }