Task Class |
Namespace: Aspose.Tasks
The Task type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | Assignments |
Gets a collection of resource assignments for this object.
|
![]() ![]() | Baselines |
Gets or sets the collection of baseline values of the task.
|
![]() ![]() | Children |
Gets a child task collection of this object.
TaskCollection object which represents children tasks.
|
![]() ![]() | ExtendedAttributes |
Gets ExtendedAttributeCollection object containing the values of an extended attribute.
|
![]() ![]() | OutlineCodes |
Gets or sets OutlineCodeCollection object.
|
![]() ![]() | ParentProject |
Gets the parent project of a task.
|
![]() ![]() | ParentTask |
Gets the parent task of a task.
|
![]() ![]() | Predecessors |
Gets a TaskCollection object which contains all predecessors of this Task object.
|
![]() ![]() | RecurringInfo |
Gets the instance of RecurringTaskInfo class for the task which is a recurring task; if the task is not a recurring one then returns null;
![]() The info for the instance of RecurringTaskInfo is present in mpp file format only. |
![]() ![]() | SplitParts |
Gets a SplitPart collection that represents the portions of a task.
|
![]() ![]() | Successors |
Gets a TaskCollection object which contains all successors of this Task object.
|
![]() ![]() | TimephasedData |
Gets or sets a TimephasedDataCollection object of this task.
The time phased data block associated with a task.
|
Name | Description | |
---|---|---|
![]() ![]() | Clone |
Creates full copy of a task without subtasks.
|
![]() ![]() | Delete |
Deletes a task from parent project tasks collection and all its assignments.
|
![]() ![]() | Equals(Object) |
Returns a value indicating whether this instance is equal to a specified object.
(Overrides ObjectEquals(Object).) |
![]() ![]() | Equals(Task) |
Returns a value indicating whether this instance is equal to a specified task.
|
![]() | Finalize | (Inherited from Object.) |
![]() ![]() | GetT |
Returns the value to which the property is mapped in this container.
|
![]() ![]() | GetHashCode |
Returns a hash code value for this Task.
(Overrides ObjectGetHashCode.) |
![]() ![]() | GetTimephasedData(DateTime, DateTime) |
Returns TimephasedDataCollection object with TimephasedData values within given start and end dates.
|
![]() ![]() | GetTimephasedData(DateTime, DateTime, TimephasedDataType) |
Returns TimephasedDataCollection object with TimephasedData values within given start and end dates of specified time-phased data type.
|
![]() | GetType | (Inherited from Object.) |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() ![]() | MoveToSibling(Int32) |
Moves the current task at the same Outline Level before a task with the specified Id.
If ParentProject.CalculationMode is None user should invoke Project.Recalculate() after using this method (It will reschedule all project tasks (start/finish dates, sets early/late dates) and calculate the dependent fields such as slacks, work and cost fields, outline levels).
If ParentProject.CalculationMode is Manual the method will calculate only task id, outline level and outline numbers automatically.
If ParentProject.CalculationMode is Automatic the method reschedules all project's tasks automatically
(start/finish dates, sets early/late dates, calculates slacks, work and cost fields, recalculates ids and outline levels).
|
![]() ![]() | MoveToSibling(Task) |
Moves the current task at the same Outline Level before the specified task.
If ParentProject.CalculationMode is None user should invoke Project.Recalculate() after using this method (It will reschedule all project tasks (start/finish dates, sets early/late dates) and calculate the dependent fields such as slacks, work and cost fields, outline levels).
If ParentProject.CalculationMode is Manual the method will calculate only task id, outline level and outline numbers automatically.
If ParentProject.CalculationMode is Automatic the method reschedules all project's tasks automatically
(start/finish dates, sets early/late dates, calculates slacks, work and cost fields, recalculates ids and outline levels).
|
![]() ![]() | OutlineIndent |
Indents a task in the outline.
|
![]() ![]() | OutlineOutdent |
Promotes a task in the outline.
|
![]() ![]() | SelectAllChildTasks |
Recursively collects all child tasks of this task.
|
![]() ![]() | SetT |
Maps the specified property to the specified value in this container.
|
![]() ![]() | ToString |
Returns short string representation of a task.
The exact details of the representation are unspecified and subject to change.
(Overrides ObjectToString.) |
The Task is representing a one atomic chuck of work.
One can use Task to plan a project by creating tasks and assign appropriate resources onto them. Tasks in a project are organized as a rooted hierarchical tree structure, with a root task and subtrees of children tasks.To build a tree of tasks one can use a specialized collection TaskCollection by accessing RootTask property e.g.:
Project project = new Project(); // add new tasks Task task1 = project.RootTask.Children.Add(); // a parent task with empty name is added Task childTask1 = task1.Children.Add("Child 1"); childTask1.Set(Tsk.Start, new DateTime(2020, 2, 12, 8, 0, 0)) childTask1.Set(Tsk.Duration, project.GetDuration(8, TimeUnitType.Hour)); childTask1.Set(Tsk.Finish, new DateTime(2020, 2, 12, 17, 0, 0)); Task childTask3 = task1.Children.Add("Child 3"); childTask3.Set(Tsk.Start, new DateTime(2020, 2, 13, 8, 0, 0)) childTask3.Set(Tsk.Duration, project.GetDuration(8, TimeUnitType.Hour)); childTask3.Set(Tsk.Finish, new DateTime(2020, 2, 13, 17, 0, 0)); Task childTask2 = task1.Children.Add("Child 2", 2); // inserts a task before the childTask3 childTask2.Set(Tsk.Start, new DateTime(2020, 2, 14, 8, 0, 0)) childTask2.Set(Tsk.Duration, project.GetDuration(8, TimeUnitType.Hour)); childTask2.Set(Tsk.Finish, new DateTime(2020, 2, 14, 17, 0, 0)); // save project in the one of available formats project.Save("Filled project.xml", SaveFileFormat.MPP);
var project = new Project(); var task = project.RootTask.Children.Add("Task1"); task.Set(Tsk.DurationFormat, TimeUnitType.Day); task.Set(Tsk.Start, new DateTime(2012, 8, 23, 8, 0, 0)); task.Set(Tsk.Duration, project.GetDuration(24, TimeUnitType.Hour)); task.Set(Tsk.ActualStart, new DateTime(2012, 8, 23, 8, 0, 0)); project.Save(OutDir + "CreateNewTask_out.xml", SaveFileFormat.Xml);