using Infragistics.Controls.Schedules;
public class ProjectDataHelper
{
public static Project GenerateProjectData()
{
Project project = new Project();
ProjectTask rootTask = new ProjectTask
{
TaskName = "Project Summary Task",
IsManual = false
};
project.RootTask.Tasks.Add(rootTask);
DateTime startTime = DateTime.Today.ToUniversalTime();
rootTask.Tasks.Add(new ProjectTask
{
TaskName = "Planning",
IsManual = false,
Start = startTime,
Duration = TimeSpan.FromHours(8),
});
rootTask.Tasks.Add(new ProjectTask
{
TaskName = "Documenting",
IsManual = false,
Start = startTime,
ManualDuration = ProjectDuration.FromFormatUnits(2, ProjectDurationFormat.Days),
ConstraintDate = DateTime.Today.AddDays(3).ToUniversalTime(),
ConstraintType = ProjectTaskConstraintType.FinishNoLaterThan,
});
rootTask.Tasks.Add(new ProjectTask
{
TaskName = "Creating Demo Application",
IsManual = false,
Start = startTime,
ManualDuration = ProjectDuration.FromFormatUnits(3, ProjectDurationFormat.Days),
ConstraintType = ProjectTaskConstraintType.MustStartOn,
ConstraintDate = DateTime.Today.AddDays(2).ToUniversalTime(),
IsEstimated = true,
});
rootTask.Tasks.Add(new ProjectTask
{
TaskName = "Collecting Feedback",
IsManual = false,
Start = startTime,
ManualDuration = ProjectDuration.FromFormatUnits(1, ProjectDurationFormat.Days),
IsEstimated = true,
});
rootTask.Tasks.Add(new ProjectTask
{
TaskName = "Designing",
IsManual = false,
Start = startTime,
ManualDuration = ProjectDuration.FromFormatUnits(5, ProjectDurationFormat.Days),
});
rootTask.Tasks.Add(new ProjectTask
{
TaskName = "Development",
IsManual = true,
ManualStart = new ManualDateTime("Still In Discussion"),
ManualDuration = ProjectDuration.FromFormatUnits(10, ProjectDurationFormat.Days),
ManualFinish = new ManualDateTime("Not Defined Yet"),
});
rootTask.Tasks.Add(new ProjectTask
{
TaskName = "Testing",
IsManual = true,
Start = startTime,
ManualDuration = ProjectDuration.FromFormatUnits(7, ProjectDurationFormat.Days),
});
rootTask.Tasks.Add(new ProjectTask
{
TaskName = "Bug Fixing",
IsManual = true,
Start = startTime,
ManualDuration = ProjectDuration.FromFormatUnits(4, ProjectDurationFormat.Days),
});
rootTask.Tasks.Add(new ProjectTask
{
TaskName = "Project Complete",
IsManual = false,
Start = startTime,
IsMilestone = true
});
return project;
}
}