private ITaskRunnerNode LoadHierarchy(string configPath)
        {
            ITaskRunnerNode           root     = new TaskRunnerNode(Constants.TASK_CATEGORY);
            string                    rootDir  = Path.GetDirectoryName(configPath);
            IEnumerable <CommandTask> commands = TaskParser.LoadTasks(configPath);

            if (commands == null)
            {
                return(root);
            }

            var tasks = new TaskRunnerNode("Commands");

            tasks.Description = "A list of command to execute";
            root.Children.Add(tasks);

            foreach (CommandTask command in commands.OrderBy(k => k.Name))
            {
                command.Arguments        = SetVariables(command.Arguments, rootDir);
                command.FileName         = SetVariables(command.FileName, rootDir);
                command.Name             = SetVariables(command.Name, rootDir);
                command.WorkingDirectory = SetVariables(command.WorkingDirectory, rootDir);

                string cwd = command.WorkingDirectory ?? rootDir;

                // Add zero width space
                string commandName = command.Name += "\u200B";
                SetDynamicTaskName(commandName);

                var task = new TaskRunnerNode(commandName, true)
                {
                    Command     = new TaskRunnerCommand(cwd, command.FileName, command.Arguments),
                    Description = $"Filename:\t {command.FileName}\r\nArguments:\t {command.Arguments}"
                };

                tasks.Children.Add(task);
            }

            return(root);
        }
        private ITaskRunnerNode LoadHierarchy(string configPath)
        {
            ITaskRunnerNode           root     = new TaskRunnerNode(Constants.TASK_CATEGORY);
            string                    rootDir  = Path.GetDirectoryName(configPath);
            IEnumerable <CommandTask> commands = TaskParser.LoadTasks(configPath);

            if (commands == null)
            {
                return(root);
            }

            var tasks = new TaskRunnerNode("Commands");

            tasks.Description = "A list of command to execute";
            root.Children.Add(tasks);

            Project proj = GetProject(rootDir);

            foreach (CommandTask command in commands.OrderBy(k => k.Name))
            {
                command.Name             = SetVariables(command.Name, rootDir);
                command.WorkingDirectory = SetVariables(command.WorkingDirectory, rootDir);

                string cwd = command.WorkingDirectory ?? rootDir;

                // Add zero width space
                string commandName = command.Name;

                TaskRunnerNode task = proj != null && command.ReloadProject ? new TaskRunnerNodeContinuation(commandName, (result) => ProjectReload.InfoBar.ShowAsync(_serviceProvider, proj)) : new TaskRunnerNode(commandName, true);
                task.Command     = new DynamicTaskRunnerCommand(this, rootDir, cwd, command.FileName, command.Arguments);
                task.Description = $"Filename:\t {command.FileName}\r\nArguments:\t {command.Arguments}";

                tasks.Children.Add(task);
            }

            return(root);
        }