TaskBaselineCollection Class

Represents a collection of TaskBaseline objects.
Inheritance Hierarchy
SystemObject
  Aspose.TasksTaskBaselineCollection

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

The TaskBaselineCollection type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleCount
Gets the number of objects contained in this TaskBaselineCollection object.
Public propertyItem
Returns the element at the specified index.
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 TaskBaselineCollection object to a list of TaskBaseline objects.
Public methodToString (Inherited from Object.)
Examples
Shows how to work with task baseline collections.
var project = new Project();

// create project baselines
var task = project.RootTask.Children.Add("Task");
project.SetBaseline(BaselineType.Baseline);

// print task baselines
Console.WriteLine("Count of task baselines: " + task.Baselines.Count);
foreach (var baseline in task.Baselines)
{
    Console.WriteLine("Baseline duration: {0}", baseline.Duration);
    Console.WriteLine("Baseline start: {0}", baseline.Start);
    Console.WriteLine("Baseline finish: {0}", baseline.Finish);
}

// lets clear all baselines
List<TaskBaseline> baselines = task.Baselines.ToList();
for (var i = 0; i < baselines.Count; i++)
{
    task.Baselines.Remove(baselines[i]);
}
See Also