Enum ConstraintType

ConstraintType enumeration

Specifies the constraint on the start or finish date of a task.

public enum ConstraintType

Values

NameValueDescription
Undefined-1The value was not defined in original project file.
AsSoonAsPossible0Start and Finish dates of Task are scheduled ASAP with respect to parent Start and Finish dates and considering TaskLinks.
AsLateAsPossible1Start and Finish dates of Task are scheduled ALAP with respect to parent Start and Finish dates and considering TaskLinks.
MustStartOn2Must Start On
MustFinishOn3Must Finish On
StartNoEarlierThan4Start No Earlier Than
StartNoLaterThan5Start No Later Than
FinishNoEarlierThan6Finish No Earlier Than
FinishNoLaterThan7Finish No Later Than

Remarks

While exporting into XML the Undefined values will be eliminated from resulting XML.

Examples

Shows how to set constraint <see cref=“Aspose.Tasks.ConstraintType” /> ConstraintType.AsSoonAsPossible constraint for a task.

var project = new Project(DataDir + "Constraints/ConstraintAsLateAsPossible.mpp");

// Set constraint As Soon As Possible for task with Id 11
var task = project.RootTask.Children.GetById(11);
task.Set(Tsk.ConstraintType, ConstraintType.AsSoonAsPossible);

SaveOptions options = new PdfSaveOptions();
options.StartDate = project.Get(Prj.StartDate);
options.Timescale = Timescale.ThirdsOfMonths;
project.Save(OutDir + "AsSoonAsPossible_out.pdf", options);

See Also