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 + "ConstraintFinishNoEarlierThan.mpp");
// ExStart:SetConstraintFinishNoEarlierThan
// Set constraint Finish No Earlier Than on task with Id 2
Task first = project1.RootTask.Children.GetById(2);
first.Set(Tsk.ConstraintType, ConstraintType.FinishNoEarlierThan);
first.Set(Tsk.ConstraintDate, new DateTime(2016, 12, 1, 18, 0, 0));
// Save project as pdf
SaveOptions options = new PdfSaveOptions();
options.StartDate = project1.Get(Prj.StartDate);
options.Timescale = Timescale.ThirdsOfMonths;
project1.Save(dataDir + "project_FinishNoEarlierThan_out.pdf", options);
// ExEnd:SetConstraintFinishNoEarlierThan
}
}