public static MenuObject AddLast(this MenuObject menu, string title, ApplicationTask task, string topic = "", string tip = "") { var sub = new MenuObject(title, task, topic, tip) { Parent = menu }; menu.SubMenus.Add(sub); return menu.Parent; }
public MenuObject(string title, ApplicationTask task = null, string topic = "", string tip = "") { Title = title; Task = task; Topic = topic; Tip = tip; Enabled = false; SubMenus = new List<MenuObject>(); }
///<summary> /// Running a task ///</summary> ///<param name="origin">Task to run the new task from.</param> ///<param name="name">Task to run</param> ///<param name="p">Optional parameters</param> public void Run(ITask origin, ApplicationTask name, params object[] p) { TestManager.Register(TestItemType.Task, name, TestAction.TaskStarted, p); }
/// <summary> /// Initializes a new instance of the <see cref="Task"/> class with the specified predefined task name of <see cref="ApplicationTask"/> and starting point of task. /// </summary> /// <param name="name">The <see cref="ApplicationTask"/> that defines the task name whose value will set.</param> /// <param name="origin">The <see cref="ITask"/> that defines the start point of task.</param> public Task(ApplicationTask name, ITask origin) { id = Guid.NewGuid(); this.name = name; this.origin = origin; }
/// <summary> /// Initializes a new instance of the <see cref="Task"/> class with the specified predefined task name of <see cref="ApplicationTask"/> class object. /// </summary> /// <param name="name">The <see cref="ApplicationTask"/> that defines the task name whose value will set.</param> public Task(ApplicationTask name) { origin = Empty; this.name = name; }
/// <summary> /// Provide a method to continue one or more tasks after completion of specified task. /// </summary> /// <param name="finishedtask">The task which will check for cmpletion.</param> /// <param name="returns">The <see cref="TaskResult"/> that defines the current status of a task.</param> /// <param name="p">The array of tasks, which will be executed.</param> public virtual void Continue(ApplicationTask finishedtask, TaskResult returns, params object[] p) { Finish(returns, p); }
/// <summary> /// Provides a method to run or execute one or more tasks. /// </summary> /// <param name="origin">The <see cref="ITask"/> that defines the start point of task.</param> /// <param name="name">The <see cref="ApplicationTask"/> that defines the name of task.</param> /// <param name="p">The array of tasks, which will be executed.</param> public static void RunTask(this ITask origin, ApplicationTask name, params object[] p) { TaskManager.Run(origin, name, p); }
public static void ExecuteAndRun(this ITask task, ApplicationTask name, params Action[] actions) { if (task.Execute(actions)) task.RunTask(name); }
/// <summary> /// Provides a method to run or execute one or more tasks. /// </summary> /// <param name="origin">The <see cref="ITask"/> that defines the start point of task.</param> /// <param name="name">The <see cref="ApplicationTask"/> that defines the name of task.</param> /// <param name="p">The array of tasks, which will be executed.</param> public void Run(ITask origin, ApplicationTask name, params object[] p) { if (!AuthorizationManager.IsAllowed(name)) { LogManager.Log("Not authorized for task " + name); return; } var mainType = Main.GetType(); var typeName = string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}Task", mainType.Namespace, Type.Delimiter, name.Name.Replace('/', Type.Delimiter)); var type = mainType.Assembly.GetType(typeName, true); object[] parms = { name, origin ?? Main }; var task = Activator.CreateInstance(type, parms) as ITask; if (task == null) return; tasks[task.Id] = task; Debug.WriteLine("Starting task: " + task.Name); task.Run(p); }
/// <summary> /// Provides a method to run or execute one or more tasks. /// </summary> /// <param name="origin">The <see cref="ITask"/> that defines the start point of task.</param> /// <param name="name">The <see cref="ApplicationTask"/> that defines the name of task.</param> /// <param name="p">The array of tasks, which will be executed.</param> public static void Run(ITask origin, ApplicationTask name, params object[] p) { Provider.Run(origin, name, p); }
/// <summary> /// Run or execute an array of tasks by the specified <see cref="ApplicationTask"/> name. /// </summary> /// <param name="name">The <see cref="ITask"/> that defines the start point of task.</param> /// <param name="p">The array of tasks, which will be executed.</param> public static void Run(ApplicationTask name, params object[] p) { Run(null, name, p); }