Enum WorkContourType
Contents
[
Hide
]WorkContourType enumeration
Specifies the contour of a work.
public enum WorkContourType
Values
Name | Value | Description |
---|---|---|
Undefined | -1 | The value was not defined in original project file. |
Flat | 0 | Flat work contour. |
BackLoaded | 1 | BackLoaded work contour. |
FrontLoaded | 2 | FrontLoaded work contour. |
DoublePeak | 3 | DoublePeak work contour. |
EarlyPeak | 4 | EarlyPeak work contour. |
LatePeak | 5 | LatePeak work contour. |
Bell | 6 | Bell work contour. |
Turtle | 7 | Turtle work contour. |
Contoured | 8 | Custom work contour. |
Remarks
While exporting into XML the Undefined values will be eliminated from resulting XML.
Examples
Shows how to set different timephased data contours for resource assignments.
var project = new Project();
project.Set(Prj.StartDate, new DateTime(2000, 1, 3, 8, 0, 0));
project.Set(Prj.FinishDate, new DateTime(2000, 1, 7, 17, 0, 0));
// add a task
var task = project.RootTask.Children.Add("Task");
task.Set(Tsk.Start, new DateTime(2000, 1, 3, 8, 0, 0));
task.Set(Tsk.Duration, project.GetDuration(8, TimeUnitType.Hour));
task.Set(Tsk.Finish, new DateTime(2000, 1, 3, 17, 0, 0));
var resource = project.Resources.Add("Resource");
// add resource assignment
var resourceAssignment = project.ResourceAssignments.Add(task, resource);
resourceAssignment.Set(Asn.Start, new DateTime(2000, 1, 3, 8, 0, 0));
resourceAssignment.Set(Asn.Work, project.GetWork(8));
resourceAssignment.Set(Asn.Finish, new DateTime(2000, 1, 3, 17, 0, 0));
// Flat contour is default contour
Console.WriteLine("Flat contour");
var collection = task.GetTimephasedData(project.Get(Prj.StartDate), project.Get(Prj.FinishDate));
foreach (var td in collection)
{
Console.WriteLine(td.Start.ToShortDateString() + " " + td.Value);
}
// Change contour
Console.WriteLine("Turtle contour");
resourceAssignment.Set(Asn.WorkContour, WorkContourType.Turtle);
collection = task.GetTimephasedData(project.Get(Prj.StartDate), project.Get(Prj.FinishDate));
foreach (var td in collection)
{
Console.WriteLine(td.Start.ToShortDateString() + " " + td.Value);
}
// Change contour
Console.WriteLine("BackLoaded contour");
resourceAssignment.Set(Asn.WorkContour, WorkContourType.BackLoaded);
collection = task.GetTimephasedData(project.Get(Prj.StartDate), project.Get(Prj.FinishDate));
foreach (var td in collection)
{
Console.WriteLine(td.Start.ToShortDateString() + " " + td.Value);
}
// Change contour
Console.WriteLine("FrontLoaded contour");
resourceAssignment.Set(Asn.WorkContour, WorkContourType.FrontLoaded);
collection = task.GetTimephasedData(project.Get(Prj.StartDate), project.Get(Prj.FinishDate));
foreach (var td in collection)
{
Console.WriteLine(td.Start.ToShortDateString() + " " + td.Value);
}
// Change contour
Console.WriteLine("Bell contour");
resourceAssignment.Set(Asn.WorkContour, WorkContourType.Bell);
collection = task.GetTimephasedData(project.Get(Prj.StartDate), project.Get(Prj.FinishDate));
foreach (var td in collection)
{
Console.WriteLine(td.Start.ToShortDateString() + " " + td.Value);
}
// Change contour
Console.WriteLine("EarlyPeak contour");
resourceAssignment.Set(Asn.WorkContour, WorkContourType.EarlyPeak);
collection = task.GetTimephasedData(project.Get(Prj.StartDate), project.Get(Prj.FinishDate));
foreach (var td in collection)
{
Console.WriteLine(td.Start.ToShortDateString() + " " + td.Value);
}
// Change contour
Console.WriteLine("LatePeak contour");
resourceAssignment.Set(Asn.WorkContour, WorkContourType.LatePeak);
collection = task.GetTimephasedData(project.Get(Prj.StartDate), project.Get(Prj.FinishDate));
foreach (var td in collection)
{
Console.WriteLine(td.Start.ToShortDateString() + " " + td.Value);
}
// Change contour
Console.WriteLine("DoublePeak contour");
resourceAssignment.Set(Asn.WorkContour, WorkContourType.DoublePeak);
collection = task.GetTimephasedData(project.Get(Prj.StartDate), project.Get(Prj.FinishDate));
foreach (var td in collection)
{
Console.WriteLine(td.Start.ToShortDateString() + " " + td.Value);
}
See Also
- namespace Aspose.Tasks
- assembly Aspose.Tasks