private void RunCommand(CommandDataViewModel argCommand)
 {
     if (this.ActiveConsole != null)
     {
         this.ActiveConsole.ExecuteCommand(argCommand);
     }
 }
示例#2
0
        public void ExecuteCommand(CommandDataViewModel argCommandData)
        {
            if (argCommandData == null)
            {
                this.ErrorMessage = "No command to execute";
                return;
            }

            if (argCommandData.IsFinal)
            {
                this.RunCommand(argCommandData.CommandText);
            }
            else
            {
                this.CurrentCommand = argCommandData.CommandText;
            }
        }
        protected override void InitializeDesignMode()
        {
            base.InitializeDesignMode();

            ConsoleProjectViewModel tmpProject = new ConsoleProjectViewModel
            {
                Name = "Project 1"
            };

            this.AddProject(tmpProject);

            CommandDataViewModel tmpCommand = new CommandDataViewModel()
            {
                Name        = "Level Up",
                CommandText = "cd..",
                IsFinal     = true
            };

            this.AvailableCommands["Global commands"] = new List <CommandDataViewModel>();
            this.AvailableCommands["Global commands"].Add(tmpCommand);

            this.ErrorMessage = "Design mode error";
        }