/// <summary> /// Create a new <see cref="SimpleTask"/> /// </summary> /// <param name="name">Name of the task</param> /// <param name="description">Description of the task, if any</param> /// <returns>The created <see cref="SimpleTask"/>, for method chaining</returns> public SimpleTask Create(string name, string?description = null) { var task = new SimpleTask(name, description); this.tasks.Add(task); return(task); }
public TaskInvocation(SimpleTask task) { this.Task = task ?? throw new ArgumentNullException(nameof(task)); this.argValues = new object[task.Invoker !.Args.Count];
internal SimpleTaskOptionException(SimpleTask task, OptionException innerException) : base($"Task: \"{task.Name}\": {innerException.Message}", innerException) { this.Task = task; }
/// <summary> /// Initialises a new instance of the <see cref="SimpleTaskDependencyNotFoundException"/> class /// </summary> /// <param name="task">Task whose dependency was not found</param> /// <param name="dependencyName">Name of the dependency which was not found</param> public SimpleTaskDependencyNotFoundException(SimpleTask task, string dependencyName) : base($"Task \"{task.Name}\": unable to find dependency \"{dependencyName}\"") { this.Task = task; this.DependencyName = dependencyName; }
/// <summary> /// Initialises a new instance of the <see cref="SimpleTaskHasNoInvocationException"/> class /// </summary> /// <param name="task">Task which has no invocation</param> public SimpleTaskHasNoInvocationException(SimpleTask task) : base($"Task \"{task.Name}\" missing a call to .Run(...)") { this.Task = task; }