/// <summary> /// Removes the binding child nodes and then adds the children back again if there are any. /// </summary> void RefreshBindingNode(TaskRunnerTreeNode taskRunnerNode, TaskRunnerBindEvent bindEvent) { // Ensure binding tab is displayed. notebook.CurrentTab = notebook.Tabs [0]; TaskRunnerBindingInformation binding = taskRunnerNode.TaskInfo.Bindings.FindBinding(bindEvent); TaskBindingTreeNode bindingNode = GetBindingTreeNode(bindEvent); TreeNavigator navigator = GetNavigator(bindingNode); if (navigator == null) { return; } navigator.RemoveChildren(); if (binding != null) { AddBindingChildNodes(taskRunnerNode.TaskInfo, binding, navigator, bindingNode); bindingsTreeView.ExpandRow(navigator.CurrentPosition, true); } else { // No more bindings. Last binding has been removed. RefreshBindingNodeName(bindingNode, navigator); } }
public void ToggleBinding(TaskRunnerBindEvent bindEvent, ITaskRunnerNode task) { if (config == null) { return; } TaskRunnerBindingInformation binding = FindBinding(bindEvent); if (binding != null) { binding.ToggleTask(task); if (!binding.AnyTasks()) { bindings.Remove(binding); } } else { binding = new TaskRunnerBindingInformation(bindEvent, task); bindings.Add(binding); } config.SaveBindings(configFile, ToXml()); }
void OnUpdateToggleBinding(CommandInfo info, TaskRunnerBindEvent bindEvent) { info.Enabled = CanRunSelectedTask(); if (info.Enabled) { info.Checked = selectedTaskRunnerNode.IsBindingEnabled(bindEvent); } }
void ToggleBinding(TaskRunnerBindEvent bindEvent) { if (CanRunSelectedTask()) { OnToggleBinding(selectedTaskRunnerNode.TaskInfo, selectedTaskRunnerNode.TaskRunner, bindEvent); RefreshBindingNode(selectedTaskRunnerNode, bindEvent); } }
public TaskBindingTreeNode(TaskRunnerBindEvent bindEvent) { BindEvent = bindEvent; RefreshName(); IsRootNode = true; tasks = new HashSet <TaskRunnerInformation> (); }
TaskBindingTreeNode AddBindingsTreeNode(TaskRunnerBindEvent bindEvent) { var node = new TaskBindingTreeNode(bindEvent); TreeNavigator navigator = bindingsTreeStore.AddNode(); navigator.SetValue(bindingNodeNameField, node.Name); navigator.SetValue(bindingNodeField, node); return(node); }
public int Count(TaskRunnerBindEvent bindEvent) { TaskRunnerBindingInformation binding = FindBinding(bindEvent); if (binding != null) { return(binding.GetTasks().Count()); } return(0); }
public bool IsBindingEnabled(TaskRunnerBindEvent bindEvent, ITaskRunnerNode taskRunnerNode) { TaskRunnerBindingInformation binding = FindBinding(bindEvent); if (binding != null) { return(binding.HasTask(taskRunnerNode)); } return(false); }
TaskBindingTreeNode GetBindingTreeNode(TaskRunnerBindEvent bindEvent) { switch (bindEvent) { case TaskRunnerBindEvent.AfterBuild: return(afterBuildBindingNode); case TaskRunnerBindEvent.BeforeBuild: return(beforeBuildBindingNode); case TaskRunnerBindEvent.Clean: return(cleanBindingNode); case TaskRunnerBindEvent.ProjectOpened: return(projectOpenBindingNode); default: return(null); } }
public IEnumerable <TaskRunnerWithOptions> GetTasks(TaskRunnerBindEvent bindEvent) { foreach (TaskRunnerInformation task in Tasks) { foreach (TaskRunnerBindingInformation binding in task.Bindings) { if (binding.BindEvent == bindEvent) { foreach (string taskName in binding.GetTasks()) { ITaskRunnerNode node = task.GetInvokableTask(taskName); if (node != null) { yield return(new TaskRunnerWithOptions(node, task.Options)); } } } } } }
public bool RemoveBinding(TaskRunnerBindEvent bindEvent, string name) { if (config == null) { return(false); } TaskRunnerBindingInformation binding = FindBinding(bindEvent); if (binding != null) { if (binding.RemoveTask(name)) { config.SaveBindings(configFile, ToXml()); return(true); } } return(false); }
public TaskRunnerBindingInformation FindBinding(TaskRunnerBindEvent bindEvent) { return(bindings.FirstOrDefault(binding => binding.BindEvent == bindEvent)); }
public void ToggleBinding(TaskRunnerBindEvent bindEvent, ITaskRunnerNode taskRunnerNode) { Bindings.ToggleBinding(bindEvent, taskRunnerNode); }
public bool IsBindingEnabled(TaskRunnerBindEvent bindEvent, ITaskRunnerNode taskRunnerNode) { return(Bindings.IsBindingEnabled(bindEvent, taskRunnerNode)); }
public async Task <BuildResult> RunBuildTasks(GroupedTaskRunnerInformation tasks, TaskRunnerBindEvent bindEvent) { var buildResult = new BuildResult(); foreach (TaskRunnerWithOptions node in tasks.GetTasks(bindEvent)) { ITaskRunnerCommandResult result = await TaskRunnerServices.Workspace.RunTask(node); if (result.ExitCode != 0) { buildResult.AddWarning(node.TaskRunner, result); } } return(buildResult); }
public bool RemoveBinding(TaskRunnerBindEvent bindEvent, string name) { return(Bindings.RemoveBinding(bindEvent, name)); }
public bool IsBindingEnabled(TaskRunnerBindEvent bindEvent) { return(taskRunnerInfo.IsBindingEnabled(bindEvent, taskRunnerNode)); }
public TaskRunnerBindingInformation(TaskRunnerBindEvent bindEvent, ITaskRunnerNode task) { this.bindEvent = bindEvent; taskNames.Add(task.Name); }
void ToggleBinding(TaskRunnerInformation taskRunnerInfo, ITaskRunnerNode node, TaskRunnerBindEvent bindEvent) { try { taskRunnerInfo.ToggleBinding(bindEvent, node); } catch (Exception ex) { LoggingService.LogError("Toggle binding failed.", ex); MessageService.ShowError(GettextCatalog.GetString("Unable to change binding."), ex); } }