TaskUsageViewFieldCollection.ToList

TaskUsageViewFieldCollection.ToList method

Returns a list which contains all items from this collection.

public IList<TaskUsageViewField> ToList()

Return Value

returns a list which contains all items from this collection.

Examples

Shows how to work field collection of a TaskUsageView instance.

var project = new Project(DataDir + "TaskUsageView.mpp");

var view = (TaskUsageView)project.Views.ToList()[2];
foreach (var field in view.FieldCollection)
{
    Console.WriteLine("Field: " + field);
}

// one can transform collection into a list of TaskUsageViewField
IList<TaskUsageViewField> fields = view.FieldCollection.ToList();
foreach (var field in fields)
{
    Console.WriteLine("Field (from the list): " + field);
}

See Also