ResourceLeveler.LevelResources

ResourceLeveler.LevelResources method

Levels tasks for the specified resources using the specified leveling options.

public static LevelingResult LevelResources(Project project, LevelingOptions options)
ParameterTypeDescription
projectProjectProject to apply resource leveling.
optionsLevelingOptionsOptions which specifies how to level resources.

Return Value

Object containing results of resource leveling.

Exceptions

exceptioncondition
ArgumentNullExceptionif parameter options is null.

Examples

Shows how to level specific resource, customize leveling options and examine leveling algorithm messages.

var project = new Project(DataDir + "Software Development Plan.mpp");

var levelingOptions = new LevelingOptions();
levelingOptions.StartDate = new DateTime(2013, 3, 10);
levelingOptions.FinishDate = new DateTime(2013, 4, 30);
levelingOptions.Resources = new List<Resource> { project.Resources.GetById(7) };
levelingOptions.MessageLevel = MessageLevel.Information;
levelingOptions.MessageHandler = new LevelingMessageHandler();

ResourceLeveler.LevelResources(project, levelingOptions);

See Also