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

Represents a collection of Resource objects. More...

#include <ResourceCollection.h>

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

Public Member Functions

int32_t get_Count () const override
 Gets the number of elements contained in the ResourceCollection. More...
 
System::SharedPtr< Projectget_ParentProject () const
 Gets the parent project of the ResourceCollection object. More...
 
System::SharedPtr< Resourceidx_get (int32_t index) const override
 Returns the element at the specified index. More...
 
void idx_set (int32_t index, System::SharedPtr< Resource > value) override
 Returns the element at the specified index. More...
 
System::SharedPtr< System::Collections::Generic::IEnumerator< System::SharedPtr< Resource > > > GetEnumerator () override
 Returns an enumerator for this collection. More...
 
System::SharedPtr< ResourceAdd ()
 Adds new resource at the last position of a project resources collection. More...
 
System::SharedPtr< ResourceAdd (const System::String &resourceName)
 Adds new resource at the last position of a project resources collection. More...
 
System::SharedPtr< ResourceAdd (const System::String &resourceName, int32_t beforeResourceId)
 Adds new resource at the specified position of a project resources collection. More...
 
System::SharedPtr< System::Collections::Generic::List< System::SharedPtr< Resource > > > ToList ()
 Converts the ResourceCollection object to a list of Resource objects. More...
 
System::SharedPtr< ResourceGetById (int32_t id)
 Returns a resource with the specified id. More...
 
System::SharedPtr< ResourceGetByUid (int32_t uid)
 Returns a resource with the specified Uid. More...
 
void Clear () override
 Direct clearing is not supported, this method just throw NotSupportedException. More...
 
bool Remove (const System::SharedPtr< Resource > &item) override
 This is the stub implementation of ICollection's Remove method, that only throws NotSupportedException More...
 

Detailed Description

Represents a collection of Resource objects.

Member Function Documentation

◆ Add() [1/3]

System::SharedPtr<Resource> Aspose::Tasks::ResourceCollection::Add ( )

Adds new resource at the last position of a project resources collection.

Returns
Added resource.

◆ Add() [2/3]

System::SharedPtr<Resource> Aspose::Tasks::ResourceCollection::Add ( const System::String &  resourceName)

Adds new resource at the last position of a project resources collection.

Parameters
resourceNameName of a resource.
Returns
Added resource.

◆ Add() [3/3]

System::SharedPtr<Resource> Aspose::Tasks::ResourceCollection::Add ( const System::String &  resourceName,
int32_t  beforeResourceId 
)

Adds new resource at the specified position of a project resources collection.

Parameters
resourceNameName of a resource.
beforeResourceIdPosition of the previous resource in a project resources collection.
Returns
Added resource.

◆ Clear()

void Aspose::Tasks::ResourceCollection::Clear ( )
override

Direct clearing is not supported, this method just throw NotSupportedException.

◆ get_Count()

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

Gets the number of elements contained in the ResourceCollection.

Read-only int32_t.

◆ get_ParentProject()

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

Gets the parent project of the ResourceCollection object.

◆ GetById()

System::SharedPtr<Resource> Aspose::Tasks::ResourceCollection::GetById ( int32_t  id)

Returns a resource with the specified id.

Parameters
idThe specified id.

O(1) complexity.

Returns
Resource with the specified id if present; otherwise, null.

◆ GetByUid()

System::SharedPtr<Resource> Aspose::Tasks::ResourceCollection::GetByUid ( int32_t  uid)

Returns a resource with the specified Uid.

Parameters
uidThe specified uid.

O(1) complexity.

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

◆ GetEnumerator()

System::SharedPtr<System::Collections::Generic::IEnumerator<System::SharedPtr<Resource> > > Aspose::Tasks::ResourceCollection::GetEnumerator ( )
override

Returns an enumerator for this collection.

Returns
an enumerator for this collection.

◆ idx_get()

System::SharedPtr<Resource> Aspose::Tasks::ResourceCollection::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::ResourceCollection::idx_set ( int32_t  index,
System::SharedPtr< Resource 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::ResourceCollection::Remove ( const System::SharedPtr< Resource > &  item)
override

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

Parameters
itemthe item to remove.
Returns
true if the item was removed; false otherwise.

◆ ToList()

System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Resource> > > Aspose::Tasks::ResourceCollection::ToList ( )

Converts the ResourceCollection object to a list of Resource objects.

Returns
List of Resource objects.