Class ResourceCollection
Namespace: Aspose.Tasks
Assembly: Aspose.Tasks.dll (25.2.0)
Represents a collection of Aspose.Tasks.Resource objects.
public class ResourceCollection : IList<resource>, ICollection<resource>, IEnumerable<resource>, IEnumerable
Inheritance
Implements
IList<resource>, ICollection<resource>, IEnumerable<resource>, 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 elements contained in the ResourceCollection.
public int Count { get; }
Property Value
ParentProject
Gets the parent project of the ResourceCollection object.
public Project ParentProject { get; }
Property Value
this[int]
Returns the element at the specified index.
public Resource this[int index] { get; set; }
Property Value
Methods
Add()
Adds new resource at the last position of a project resources collection.
public Resource Add()
Returns
Added resource.
Add(string)
Adds new resource at the last position of a project resources collection.
public Resource Add(string resourceName)
Parameters
resourceName
string
Name of a resource.
Returns
Added resource.
Add(string, int)
Adds new resource at the specified position of a project resources collection.
public Resource Add(string resourceName, int beforeResourceId)
Parameters
resourceName
string
Name of a resource.
beforeResourceId
int
Position of the previous resource in a project resources collection.
Returns
Added resource.
Clear()
Direct clearing is not supported, this method just throw NotSupportedException.
public void Clear()
GetById(int)
Returns a resource with the specified id.
public Resource GetById(int id)
Parameters
id
int
The specified id.
Returns
Resource with the specified id if present; otherwise, null.
Remarks
O(1) complexity.
GetByUid(int)
Returns a resource with the specified Uid.
public Resource GetByUid(int uid)
Parameters
uid
int
The specified uid.
Returns
Resource with the specified uid if present; otherwise, null.
Remarks
O(1) complexity.
GetEnumerator()
Returns an enumerator for this collection.
public IEnumerator<resource> GetEnumerator()
Returns
IEnumerator<Resource>
an enumerator for this collection.
Remove(Resource)
This is the stub implementation of ICollection’s Remove method, that only throws NotSupportedException
public bool Remove(Resource item)
Parameters
item
Resource
the item to remove.
Returns
true
if the item was removed; false
otherwise.
ToList()
Converts the ResourceCollection object to a list of Aspose.Tasks.Resource objects.
public List<resource> ToList()
Returns
List of Aspose.Tasks.Resource objects. </resource></resource></resource>