Aspose.Tasks for C++
Aspose::Tasks::ResourceAssignmentCollection Class Reference

Represents a collection of ResourceAssignment objects. More...

#include <ResourceAssignmentCollection.h>

Inherits System::Collections::Generic::IList< typename >.

Public Member Functions

System::SharedPtr< Projectget_ParentProject () const
 Gets the parent project of the ResourceAssignmentCollection object. More...
 
bool get_IsReadOnly () const override
 Gets a value indicating whether this collection is read only. More...
 
int32_t get_Count () const override
 Gets the number of objects contained in the ResourceAssignmentCollection. More...
 
System::SharedPtr< ResourceAssignmentidx_get (int32_t index) const override
 Returns the element at the specified index. More...
 
void idx_set (int32_t index, System::SharedPtr< ResourceAssignment > value) override
 Returns the element at the specified index. More...
 
System::SharedPtr< System::Collections::Generic::IEnumerator< System::SharedPtr< ResourceAssignment > > > GetEnumerator () override
 Returns an enumerator for this collection. More...
 
System::SharedPtr< System::Collections::Generic::List< System::SharedPtr< ResourceAssignment > > > ToList ()
 Converts the ResourceAssignmentCollection object to a list of ResourceAssignment objects. More...
 
System::SharedPtr< ResourceAssignmentAdd (const System::SharedPtr< Task > &task, const System::SharedPtr< Resource > &resource, double units)
 Adds new assignment to the ResourceAssignmentCollection. More...
 
System::SharedPtr< ResourceAssignmentAdd (const System::SharedPtr< Task > &task, const System::SharedPtr< Resource > &resource, System::Decimal cost)
 Adds new assignment to the ResourceAssignmentCollection. More...
 
System::SharedPtr< ResourceAssignmentAdd (const System::SharedPtr< Task > &task, const System::SharedPtr< Resource > &resource)
 Adds new assignment to the ResourceAssignmentCollection. More...
 
System::SharedPtr< ResourceAssignmentGetByUid (int32_t uid)
 Returns an assignment with the specified uid. More...
 
bool Remove (const System::SharedPtr< ResourceAssignment > &item) override
 Removes specified assignment from collection, if it is not read-only, otherwise throws NotSupportedException. More...
 
void RemoveAt (int32_t index) override
 Removes assignment at specified index, if collection is not read-only, otherwise throws NotSupportedException. More...
 
void Add (const System::SharedPtr< ResourceAssignment > &item) override
 This is the stub implementation of ICollection's Add method, that only throws NotSupportedException More...
 

Detailed Description

Represents a collection of ResourceAssignment objects.

Member Function Documentation

◆ Add() [1/4]

void Aspose::Tasks::ResourceAssignmentCollection::Add ( const System::SharedPtr< ResourceAssignment > &  item)
override

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

Parameters
itemThe item to remove.

◆ Add() [2/4]

System::SharedPtr<ResourceAssignment> Aspose::Tasks::ResourceAssignmentCollection::Add ( const System::SharedPtr< Task > &  task,
const System::SharedPtr< Resource > &  resource 
)

Adds new assignment to the ResourceAssignmentCollection.

Parameters
taskA task to be assigned.
resourceA resource to be assigned.
Returns
Added assignment.

◆ Add() [3/4]

System::SharedPtr<ResourceAssignment> Aspose::Tasks::ResourceAssignmentCollection::Add ( const System::SharedPtr< Task > &  task,
const System::SharedPtr< Resource > &  resource,
double  units 
)

Adds new assignment to the ResourceAssignmentCollection.

Parameters
taskA task to be assigned.
resourceA resource to be assigned.
unitsThe number of units for a new assignment.
Returns
Added assignment.

◆ Add() [4/4]

System::SharedPtr<ResourceAssignment> Aspose::Tasks::ResourceAssignmentCollection::Add ( const System::SharedPtr< Task > &  task,
const System::SharedPtr< Resource > &  resource,
System::Decimal  cost 
)

Adds new assignment to the ResourceAssignmentCollection.

Parameters
taskA task to be assigned.
resourceA cost resource to be assigned.
costThe cost for a new assignment.
Returns
Added assignment.

◆ get_Count()

int32_t Aspose::Tasks::ResourceAssignmentCollection::get_Count ( ) const
override

Gets the number of objects contained in the ResourceAssignmentCollection.

◆ get_IsReadOnly()

bool Aspose::Tasks::ResourceAssignmentCollection::get_IsReadOnly ( ) const
override

Gets a value indicating whether this collection is read only.

◆ get_ParentProject()

System::SharedPtr<Project> Aspose::Tasks::ResourceAssignmentCollection::get_ParentProject ( ) const

Gets the parent project of the ResourceAssignmentCollection object.

◆ GetByUid()

System::SharedPtr<ResourceAssignment> Aspose::Tasks::ResourceAssignmentCollection::GetByUid ( int32_t  uid)

Returns an assignment with the specified uid.

Parameters
uidThe specified uid.

O(1) complexity.

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

◆ GetEnumerator()

System::SharedPtr<System::Collections::Generic::IEnumerator<System::SharedPtr<ResourceAssignment> > > Aspose::Tasks::ResourceAssignmentCollection::GetEnumerator ( )
override

Returns an enumerator for this collection.

Returns
an enumerator for this collection.

◆ idx_get()

System::SharedPtr<ResourceAssignment> Aspose::Tasks::ResourceAssignmentCollection::idx_get ( int32_t  index) const
override

Returns the element at the specified index.

Parameters
indexThe zero-based index of the element to get.
Returns
the element at the specified index.

◆ idx_set()

void Aspose::Tasks::ResourceAssignmentCollection::idx_set ( int32_t  index,
System::SharedPtr< ResourceAssignment value 
)
override

Returns the element at the specified index.

Parameters
indexThe zero-based index of the element to get.
valuethe element at the specified index.

◆ Remove()

bool Aspose::Tasks::ResourceAssignmentCollection::Remove ( const System::SharedPtr< ResourceAssignment > &  item)
override

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

Parameters
itemThe assignment to remove.
Returns
true, if specified item was removed, false otherwise.

◆ RemoveAt()

void Aspose::Tasks::ResourceAssignmentCollection::RemoveAt ( int32_t  index)
override

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

Parameters
indexZero-based index.

◆ ToList()

System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<ResourceAssignment> > > Aspose::Tasks::ResourceAssignmentCollection::ToList ( )

Converts the ResourceAssignmentCollection object to a list of ResourceAssignment objects.

Returns
List of ResourceAssignment objects.