Esempio n. 1
0
 public TerminalController(TerminalApi terminalApi)
 {
     _terminalApi = terminalApi;
 }
Esempio n. 2
0
File: Program.cs Progetto: 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);
        }