Class ResourceUsageViewFieldCollection

ResourceUsageViewFieldCollection class

Represent a collection of ResourceUsageViewField values.

public class ResourceUsageViewFieldCollection : IList<ResourceUsageViewField>

Methods

NameDescription
GetEnumerator()Returns an enumerator for this collection.
ToList()Converts the instance of the ResourceUsageViewFieldCollection class to a list containing the instances of the ResourceUsageViewField class.

Examples

Shows how to work field collection of a ResourceUsageView instance.

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

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

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

See Also