BaselineCollection Class

Represents a collection of Baseline objects.
Inheritance Hierarchy
SystemObject
  Aspose.TasksBaselineCollection

Namespace:  Aspose.Tasks
Assembly:  Aspose.Tasks (in Aspose.Tasks.dll) Version: 21.10
Syntax
public class BaselineCollection : IList<Baseline>, 
	ICollection<Baseline>, IEnumerable<Baseline>, IEnumerable

The BaselineCollection type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleCount
Gets the number of objects contained in this BaselineCollection object.
Public propertyItem
Returns the element at the specified index.
Public propertyCode exampleParentResource
Gets the parent Resource for this collection.
Methods
  NameDescription
Public methodAdd
This is the stub implementation of ICollection's Add method, that only throws NotSupportedException
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodCode exampleGetEnumerator
Returns an enumerator for this collection.
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodCode exampleRemove
Removes baseline from this collection.
Public methodCode exampleToList
Converts the BaselineCollection object to a list of Baseline objects.
Public methodToString (Inherited from Object.)
Examples
Shows how to work with baseline collections.
var project = new Project(DataDir + "WorkWithBaselineCollection.mpp");
var resource = project.Resources.GetByUid(1);

Console.WriteLine("Count of assignment baselines: " + resource.Baselines.Count);
Console.WriteLine("Parent Resource Name: " + resource.Baselines.ParentResource.Get(Rsc.Name));

// read baseline information
foreach (var baseline in resource.Baselines)
{
    Console.WriteLine("Baseline Number: " + baseline.BaselineNumber);
    Console.WriteLine("Cost: " + baseline.Cost);
    Console.WriteLine("Work: " + baseline.Work);
    Console.WriteLine("BCWP: " + baseline.Bcwp);
    Console.WriteLine("BCWS: " + baseline.Bcws);
    Console.WriteLine();
}

Console.WriteLine("Delete all baselines: ");
List<Baseline> baselines = resource.Baselines.ToList();
foreach (var baseline in baselines)
{
    Console.WriteLine("Delete baseline with name: " + baseline.BaselineNumber);
    resource.Baselines.Remove(baseline);
}
See Also