public static void Run()
{
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName);
// Create project instance
Project project1 = new Project(dataDir + "ConstraintAsLateAsPossible.mpp");
// ExStart:SetConstraintAsLateAsPossible
// Set constraint As Late As Possible for task with Id 11
Task wallBoard = project1.RootTask.Children.GetById(11);
wallBoard.Set(Tsk.ConstraintType, ConstraintType.AsLateAsPossible);
// Save project as pdf
SaveOptions options = new PdfSaveOptions();
options.StartDate = project1.Get(Prj.StartDate);
options.Timescale = Timescale.ThirdsOfMonths;
project1.Save(dataDir + "project_AsLateAsPossible_out.pdf", options);
// ExEnd:SetConstraintAsLateAsPossible
}
}