public void Add(Task t) { if(! ToRun.Contains(t)) { ToRun.Add(t,new RunManifestItem{Task=t}); } }
public void Run(Recipe recipe, Task task, params object[] parameters ) { //TODO: Tasks should run in their own appdomain? // We need to create an app domain that has the // base dir the same as the target assembly var recipeInstance = Activator.CreateInstance(recipe.Class); SetContextualInformationIfInheritsRecipeBase(recipeInstance); task.Method.Invoke(recipeInstance, parameters); }
private static void CreateDependentTasks(Type type, string[] dependencies, Task task) { foreach(string methodName in dependencies) { var dependee = type.GetMethod(methodName); if(dependee == null) throw new Exception(String.Format("No dependee method {0}",methodName)); task.DependsOnMethods.Add(dependee); } }
private static Task CreateTaskFromAttribute(MethodInfo method, TaskAttribute ta) { Task t = new Task(); if(! String.IsNullOrEmpty(ta.Name)) t.Name = ta.Name; else t.Name = method.Name.Replace("Task", "").ToLower(); t.Method = method; if(! String.IsNullOrEmpty(ta.Description)) t.Description = ta.Description; else t.Description = ""; return t; }