ResourceAssignment Class

Represents a resource assignment in a project.
Inheritance Hierarchy
SystemObject
  Aspose.TasksResourceAssignment

Namespace:  Aspose.Tasks
Assembly:  Aspose.Tasks (in Aspose.Tasks.dll) Version: 21.10
Syntax
public class ResourceAssignment : IEquatable<ResourceAssignment>

The ResourceAssignment type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleBaselines
Gets AssignmentBaselineCollection object. The collection of baseline values associated with an assignment.
Public propertyCode exampleExtendedAttributes
Gets or sets an instance of the ExtendedAttributeCollection class for this object.
Public propertyCode exampleGuid
Gets or sets unique identifier for this assignment.
Public propertyCode exampleParentProject
Gets parent project for this assignment.
Public propertyCode exampleTimephasedData
Gets or sets the instance of TimephasedDataCollection class containing elements of TimephasedData class.
Methods
  NameDescription
Public methodCode exampleDelete
Deletes resource assignment from project assignments collection.
Public methodCode exampleEquals(Object)
Returns a value indicating whether this instance is equal to a specified object.
(Overrides ObjectEquals(Object).)
Public methodCode exampleEquals(ResourceAssignment)
Returns a value indicating whether this instance is equal to a specified instance of the ResourceAssignment class.
Protected methodFinalize (Inherited from Object.)
Public methodCode exampleGetT
Returns the value to which the property is mapped in this container.
Public methodCode exampleGetHashCode
Returns a hash code value for the instance of the ResourceAssignment class.
(Overrides ObjectGetHashCode.)
Public methodCode exampleGetTimephasedData(DateTime, DateTime)
Returns TimephasedDataCollection object with the instances of TimephasedData class within given start and end dates of AssignmentWork.
Public methodCode exampleGetTimephasedData(DateTime, DateTime, TimephasedDataType)
Returns the instance TimephasedDataCollection class containing instances of TimephasedData class within given start and end dates of specified TimephasedDataType.
Public methodGetType (Inherited from Object.)
Public methodCode exampleMakeTPs
Generates a list of time phased data.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodCode exampleSetT
Maps the specified property to the specified value in this container.
Public methodCode exampleSplitTask
Splits task into two parts.
Public methodCode exampleTimephasedDataFromTaskDuration
Generates list of time phased data based on the task duration and the scheduled start date.
Public methodCode exampleToString
Returns short string representation of the instance of the ResourceAssignment class. The exact details of the representation are unspecified and subject to change.
(Overrides ObjectToString.)
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