GetTimephasedWork

GetTimephasedWork(DateTime, DateTime, TimephasedDataType)

Gets amount of timephased work for the specified date time interval.

public TimeSpan GetTimephasedWork(DateTime start, DateTime end, 
    TimephasedDataType timephasedDataType)
ParameterTypeDescription
startDateTimeStart of the date time interval.
endDateTimeEnd of the date time interval.
timephasedDataTypeTimephasedDataTypeType of the timephased data to use.

Examples

Shows how to calculate assignment’s work for arbitrary date time interval.

var project = new Project(DataDir + "BaselineTD2010_3.mpp");

var assignment = project.ResourceAssignments.GetByUid(2);

// Print assignmen's work for each hour.
for (DateTime hour = assignment.Start; hour <= assignment.Finish; hour = hour.AddHours(1))
{
    var work = assignment.GetTimephasedWork(hour, hour.AddHours(1), TimephasedDataType.AssignmentWork);
    Console.WriteLine("{0} : {1:N2}", hour, work.TotalHours);
}

See Also


GetTimephasedWork(DateTime, DateTime)

Gets amount of timephased work for the specified date time interval.

public TimeSpan GetTimephasedWork(DateTime start, DateTime end)
ParameterTypeDescription
startDateTimeStart of the date time interval.
endDateTimeEnd of the date time interval.

See Also