Class ResourceAssignmentCollection

Class ResourceAssignmentCollection

Namespace: Aspose.Tasks
Assembly: Aspose.Tasks.dll (25.2.0)

Represents a collection of Aspose.Tasks.ResourceAssignment objects.

public class ResourceAssignmentCollection : IList<resourceassignment>, ICollection<resourceassignment>, IEnumerable<resourceassignment>, IEnumerable

Inheritance

objectResourceAssignmentCollection

Implements

IList<resourceassignment>, ICollection<resourceassignment>, IEnumerable<resourceassignment>, IEnumerable

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Properties

Count

Gets the number of objects contained in the ResourceAssignmentCollection.

public int Count { get; }

Property Value

int

IsReadOnly

Gets a value indicating whether this collection is read only.

public bool IsReadOnly { get; }

Property Value

bool

ParentProject

Gets the parent project of the ResourceAssignmentCollection object.

public Project ParentProject { get; }

Property Value

Project

this[int]

Returns the element at the specified index.

public ResourceAssignment this[int index] { get; set; }

Property Value

ResourceAssignment

Methods

Add(Task, Resource, double)

Adds new assignment to the ResourceAssignmentCollection.

public ResourceAssignment Add(Task task, Resource resource, double units)

Parameters

task Task

A task to be assigned.

resource Resource

A resource to be assigned.

units double

The number of units for a new assignment.

Returns

ResourceAssignment

Added assignment.

Add(Task, Resource, decimal)

Adds new assignment to the ResourceAssignmentCollection.

public ResourceAssignment Add(Task task, Resource resource, decimal cost)

Parameters

task Task

A task to be assigned.

resource Resource

A cost resource to be assigned.

cost decimal

The cost for a new assignment.

Returns

ResourceAssignment

Added assignment.

Add(Task, Resource)

Adds new assignment to the ResourceAssignmentCollection.

public ResourceAssignment Add(Task task, Resource resource)

Parameters

task Task

A task to be assigned.

resource Resource

A resource to be assigned.

Returns

ResourceAssignment

Added assignment.

Add(ResourceAssignment)

This is the stub implementation of ICollection’s Add method, that only throws NotSupportedException

public void Add(ResourceAssignment item)

Parameters

item ResourceAssignment

The item to remove.

GetByUid(int)

Returns an assignment with the specified uid.

public ResourceAssignment GetByUid(int uid)

Parameters

uid int

The specified uid.

Returns

ResourceAssignment

ResourceAssignment with the specified uid if present; otherwise, null.

Remarks

O(1) complexity.

GetEnumerator()

Returns an enumerator for this collection.

public IEnumerator<resourceassignment> GetEnumerator()

Returns

IEnumerator<ResourceAssignment&gt;

an enumerator for this collection.

Remove(ResourceAssignment)

Removes specified assignment from collection, if it is not read-only, otherwise throws NotSupportedException.

public bool Remove(ResourceAssignment item)

Parameters

item ResourceAssignment

The assignment to remove.

Returns

bool

true, if specified item was removed, false otherwise.

RemoveAt(int)

Removes assignment at specified index, if collection is not read-only, otherwise throws NotSupportedException.

public void RemoveAt(int index)

Parameters

index int

Zero-based index.

ToList()

Converts the ResourceAssignmentCollection object to a list of Aspose.Tasks.ResourceAssignment objects.

public List<resourceassignment> ToList()

Returns

List<ResourceAssignment&gt;

List of Aspose.Tasks.ResourceAssignment objects. </resourceassignment></resourceassignment></resourceassignment>