ProjectTask firstTask = this.gantt.Project.RootTask.Tasks[0];
// Setting two dependencies for a task
// firstTask.Tasks[0].SuccessorsIdText = "3,4";
firstTask.Tasks[0].Successors.Add(firstTask.Tasks[1]);
firstTask.Tasks[0].Successors.Add(firstTask.Tasks[2]);
// Setting Finish-to-Start dependency
// and a lead time of 50% between dependent tasks
// The overlap between the tasks is 50% percent of the predecessor task duration
// firstTask.Tasks[1].SuccessorsIdText = "4FS-50%";
firstTask.Tasks[1].Successors.Add(firstTask.Tasks[2], ProjectTaskLinkType.FinishToStart, ProjectDuration.FromFormatUnits(-50, ProjectDurationFormat.Percent));
// Setting a lead time of two days
// firstTask.Tasks[3].PredecessorsIdText = "4FS-2 days";
firstTask.Tasks[3].Predecessors.Add(firstTask.Tasks[2], ProjectTaskLinkType.FinishToStart, ProjectDuration.FromFormatUnits(-2, ProjectDurationFormat.Days));
// Setting delay (lag time) of 1 day between dependent tasks
// firstTask.Tasks[4].PredecessorsIdText = "5SS+1d";
firstTask.Tasks[4].Predecessors.Add(firstTask.Tasks[3], ProjectTaskLinkType.StartToStart, ProjectDuration.FromFormatUnits(1, ProjectDurationFormat.Days));