ResourceAssignment

ResourceAssignment class

Represents a resource assignment in a project.

public class ResourceAssignment : IEquatable<ResourceAssignment>

Properties

NameDescription
ActualCost { get; set; }Gets or sets a value of ActualCost.
ActualFinish { get; set; }Gets or sets a value of ActualFinish.
ActualOvertimeCost { get; set; }Gets or sets a value of ActualOvertimeCost.
ActualOvertimeWork { get; set; }Gets or sets a value of ActualOvertimeWork.
ActualOvertimeWorkProtected { get; set; }Gets or sets a value of ActualOvertimeWorkProtected.
ActualStart { get; set; }Gets or sets a value of ActualStart.
ActualWork { get; set; }Gets or sets a value of ActualWork.
ActualWorkProtected { get; set; }Gets or sets a value of ActualWorkProtected.
ACWP { get; set; }Gets or sets a value of ACWP.
AssignmentOwner { get; set; }Gets or sets a value of AssignmentOwner.
AssignmentOwnerGuid { get; set; }Gets or sets a value of AssignmentOwnerGuid.
Baselines { get; }Gets AssignmentBaselineCollection object. The collection of baseline values associated with an assignment.
BCWP { get; set; }Gets or sets a value of BCWP.
BCWS { get; set; }Gets or sets a value of BCWS.
BookingType { get; set; }Gets or sets a value of BookingType.
BudgetCost { get; set; }Gets or sets a value of BudgetCost.
BudgetWork { get; set; }Gets or sets a value of BudgetWork.
Confirmed { get; set; }Gets or sets a value indicating whether Confirmed is set or not.
Cost { get; set; }Gets or sets a value of Cost.
CostRateTableType { get; set; }Gets or sets a value of CostRateTableType.
CostVariance { get; set; }Gets or sets a value of CostVariance.
Created { get; set; }Gets or sets a value of Created.
CV { get; set; }Gets or sets a value of CV.
Delay { get; set; }Gets or sets a value of Delay.
ExtendedAttributes { get; set; }Gets or sets an instance of the ExtendedAttributeCollection class for this object.
Finish { get; set; }Gets or sets a value of Finish.
FinishVariance { get; set; }Gets or sets a value of FinishVariance.
FixedMaterial { get; set; }Gets or sets a value indicating whether FixedMaterial is set or not.
Guid { get; set; }Gets or sets unique identifier for this assignment.
HasFixedRateUnits { get; set; }Gets or sets a value indicating whether HasFixedRateUnits is set or not.
Hyperlink { get; set; }Gets or sets a value of Hyperlink.
HyperlinkAddress { get; set; }Gets or sets a value of HyperlinkAddress.
HyperlinkSubAddress { get; set; }Gets or sets a value of HyperlinkSubAddress.
LevelingDelay { get; set; }Gets or sets a value of LevelingDelay.
LinkedFields { get; set; }Gets or sets a value indicating whether LinkedFields is set or not.
Milestone { get; set; }Gets or sets a value indicating whether Milestone is set or not.
NotesRTF { get; set; }Gets or sets the text notes in RTF format. Supported for MPP formats only.
NotesText { get; set; }Gets or sets notes’ plain text extracted from RTF data.
Overallocated { get; set; }Gets or sets a value indicating whether Overallocated is set or not.
OvertimeCost { get; set; }Gets or sets a value of OvertimeCost.
OvertimeWork { get; set; }Gets or sets a value of OvertimeWork.
ParentProject { get; }Gets parent project for this assignment.
PeakUnits { get; set; }Gets or sets a value of PeakUnits.
PercentWorkComplete { get; set; }Gets or sets a value of PercentWorkComplete.
RateScale { get; set; }Gets or sets a value of RateScale.
RegularWork { get; set; }Gets or sets a value of RegularWork.
RemainingCost { get; set; }Gets or sets a value of RemainingCost.
RemainingOvertimeCost { get; set; }Gets or sets a value of RemainingOvertimeCost.
RemainingOvertimeWork { get; set; }Gets or sets a value of RemainingOvertimeWork.
RemainingWork { get; set; }Gets or sets a value of RemainingWork.
Resource { get; set; }The resource assigned to a task.
ResponsePending { get; set; }Gets or sets a value indicating whether ResponsePending is set or not.
Resume { get; set; }Gets or sets a value of Resume.
Start { get; set; }Gets or sets a value of Start.
StartVariance { get; set; }Gets or sets a value of StartVariance.
Stop { get; set; }Gets or sets a value of Stop.
Summary { get; set; }Gets or sets a value indicating whether Summary is set or not.
SV { get; set; }Gets or sets a value of SV.
Task { get; set; }The task to which a resource is assigned.
TimephasedData { get; set; }Gets or sets the instance of TimephasedDataCollection class containing elements of TimephasedData class.
Uid { get; set; }Gets or sets a value of Uid.
Units { get; set; }Gets or sets a value of Units.
UpdateNeeded { get; set; }Gets or sets a value indicating whether UpdateNeeded is set or not.
VAC { get; set; }Gets or sets a value of VAC.
Work { get; set; }Gets or sets a value of Work.
WorkContour { get; set; }Gets or sets a value of WorkContour.
WorkVariance { get; set; }Gets or sets a value of WorkVariance.

Methods

NameDescription
Delete()Deletes resource assignment from project assignments collection.
override Equals(object)Returns a value indicating whether this instance is equal to a specified object.
Equals(ResourceAssignment)Returns a value indicating whether this instance is equal to a specified instance of the ResourceAssignment class.
Get<T>(Key<T, AsnKey>)Returns the value to which the property is mapped in this container.
override GetHashCode()Returns a hash code value for the instance of the ResourceAssignment class.
GetTimephasedData(DateTime, DateTime)Returns TimephasedDataCollection object with the instances of TimephasedData class within given start and end dates of AssignmentWork.
GetTimephasedData(DateTime, DateTime, TimephasedDataType)Returns the instance TimephasedDataCollection class containing instances of TimephasedData class within given start and end dates of specified TimephasedDataType.
GetTimephasedWork(DateTime, DateTime)Gets amount of timephased work for the specified date time interval.
GetTimephasedWork(DateTime, DateTime, TimephasedDataType)Gets amount of timephased work for the specified date time interval.
MakeTPs(DateTime, TimeSpan, Calendar, List<TimephasedData>, bool, int)Generates a list of time phased data.
Set<T>(Key<T, AsnKey>, T)Maps the specified property to the specified value in this container.
SplitTask(DateTime, DateTime, Calendar)Splits task into two parts.
TimephasedDataFromTaskDuration(Calendar)Generates list of time phased data based on the task duration and the scheduled start date.
override ToString()Returns short string representation of the instance of the ResourceAssignment class. The exact details of the representation are unspecified and subject to change.

Examples

Shows how to create an assignment and get/set common assignment properties.

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

var task = project.RootTask.Children.Add("Task");
task.Set(Tsk.Start, new DateTime(2020, 4, 2, 8, 0, 0));
task.Set(Tsk.Duration, project.GetDuration(1));
task.Set(Tsk.Finish, new DateTime(2020, 4, 2, 17, 0, 0));
var resource = project.Resources.Add("Resource");
var resourceAssignment = project.ResourceAssignments.Add(task, resource);
resourceAssignment.Set(Asn.Start, new DateTime(2020, 4, 2, 8, 0, 0));
resourceAssignment.Set(Asn.Work, project.GetWork(1));
resourceAssignment.Set(Asn.Finish, new DateTime(2020, 4, 2, 17, 0, 0));

Console.WriteLine(resourceAssignment.Get(Asn.Start));
Console.WriteLine(resourceAssignment.Get(Asn.Work));
Console.WriteLine(resourceAssignment.Get(Asn.Finish));

See Also