Class Project

Class Project

Namespace: Aspose.Tasks
Assembly: Aspose.Tasks.dll (25.2.0)

Represents a project.

public class Project

Inheritance

objectProject

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Remarks

The Project is a central class in the Aspose.Tasks library.

One can use Project to read one of supported project management formats: MPP, MPT, MPX, XML.

To load an existing document in any of the supported formats, pass a file name or a stream into one of the Project constructors. To create a blank project, call the parameterless constructor.

Use one of the Save method overloads to save the project in any of the Aspose.Tasks.Saving.SaveFileFormat formats: Primavera: P6 XML, PM XER; Microsoft Excel: XLSX, XML; Fixed Layout: PDF; Images: JPEG, PNG, BMP, TIFF, SVG; Text: TXT; Others: HTML.

The Project stores project-wide information such as Aspose.Tasks.Project.Views, Aspose.Tasks.Project.BuiltInProps, Aspose.Tasks.Project.CustomProps, and Aspose.Tasks.Project.ExtendedAttributes. Most of these objects are accessible via the corresponding properties of the Project class.

The Project is a root entity that contains entry points to manipulate other project entities, such as Aspose.Tasks.Task, Aspose.Tasks.Resource, Aspose.Tasks.ResourceAssignment, Aspose.Tasks.ExtendedAttribute and Aspose.Tasks.Calendar.

The Project entities can be accessed via typed collections, for example Aspose.Tasks.Task.Children, Aspose.Tasks.Project.Resources, Aspose.Tasks.Project.ResourceAssignments, etc.

Constructors

Project()

Initializes a new instance of the Aspose.Tasks.Project class.

public Project()

Project(string, string)

Initializes a new instance of the Aspose.Tasks.Project class from a password protected template (existent mpp or mpt file).

public Project(string projectTemplate, string protectionPassword)

Parameters

projectTemplate string

Path to template to create project from.

protectionPassword string

Protection password.

Remarks

Reading password protected files currently supported for MSP 2003 file format only.

Project(string)

Initializes a new instance of the Aspose.Tasks.Project class from a template (existent mpp or mpt file).

public Project(string projectTemplate)

Parameters

projectTemplate string

Path to template to create project from.

Project(Stream, PrimaveraReadOptions)

Initializes a new instance of the Aspose.Tasks.Project class from the Stream with the specified instance of the Aspose.Tasks.PrimaveraReadOptions class.

public Project(Stream stream, PrimaveraReadOptions options)

Parameters

stream Stream

Stream of the Project System.IO.Streamclass

options PrimaveraReadOptions

the specified instance of the Aspose.Tasks.PrimaveraReadOptionsclass which allows to customize reading of Primavera formats (XER or XML).

Project(string, ParseErrorCallback)

Initializes a new instance of the Aspose.Tasks.Project class from a template (existent mpp or mpt file).

public Project(string projectTemplate, ParseErrorCallback parseErrorHandler)

Parameters

projectTemplate string

Path to template to create project from.

parseErrorHandler ParseErrorCallback

the specified callback method to handle xml parse errors.

Project(Stream)

Initializes a new instance of the Aspose.Tasks.Project class from a stream.

public Project(Stream stream)

Parameters

stream Stream

Stream to load a template from.

Project(StreamReader)

Initializes a new instance of the Aspose.Tasks.Project class from a StreamReader instance.

public Project(StreamReader reader)

Parameters

reader StreamReader

The stream reader where to load a template from.

Project(string, PrimaveraReadOptions)

Initializes a new instance of the Aspose.Tasks.Project class from a template (existent MPP or MPT file) with the specified instance of the Aspose.Tasks.PrimaveraReadOptions class.

public Project(string projectTemplate, PrimaveraReadOptions options)

Parameters

projectTemplate string

Path to template to create project from

options PrimaveraReadOptions

the specified instance of the Aspose.Tasks.PrimaveraReadOptions class.

Project(DbSettings)

Initializes a new instance of the Aspose.Tasks.Project class to read data from a database which is specified by the instance of the Aspose.Tasks.Connectivity.DbSettings class.

public Project(DbSettings settings)

Parameters

settings DbSettings

the specified instance of the Aspose.Tasks.Connectivity.DbSettings class.

Project(Stream, ParseErrorCallback)

Initializes a new instance of the Aspose.Tasks.Project class from a template(existent mpp or mpt file).

public Project(Stream stream, ParseErrorCallback parseErrorHandler)

Parameters

stream Stream

Stream to load a template from.

parseErrorHandler ParseErrorCallback

the specified callback method to handle xml parse errors.

Project(Stream, string)

Initializes a new instance of the Aspose.Tasks.Project class from a template(existent mpp or mpt file).

public Project(Stream stream, string protectionPassword)

Parameters

stream Stream

Stream to load a template from.

protectionPassword string

Protection password.

Remarks

Reading password protected files currently supported for MSP 2003 file format only.

Project(string, LoadOptions)

Initializes a new instance of the Aspose.Tasks.Project class from a template (existent mpp or mpt file) with the specified instance of the Aspose.Tasks.LoadOptions class.

public Project(string projectTemplate, LoadOptions options)

Parameters

projectTemplate string

Path to template to create project from

options LoadOptions

the specified instance of the Aspose.Tasks.LoadOptions class.

Project(Stream, LoadOptions)

Initializes a new instance of the Aspose.Tasks.Project class from the Stream with the specified instance of the Aspose.Tasks.LoadOptions class.

public Project(Stream stream, LoadOptions options)

Parameters

stream Stream

Stream of the Project System.IO.Streamclass

options LoadOptions

the specified instance of the Aspose.Tasks.LoadOptionsclass

Properties

ActualsInSync

Gets or sets a value indicating whether ActualsInSync is set or not.

[EntityField]
public NullableBool ActualsInSync { get; set; }

Property Value

NullableBool

AdminProject

Gets or sets a value indicating whether AdminProject is set or not.

[EntityField]
public NullableBool AdminProject { get; set; }

Property Value

NullableBool

AreEditableActualCosts

Gets or sets a value indicating whether AreEditableActualCosts is set or not.

[EntityField]
public NullableBool AreEditableActualCosts { get; set; }

Property Value

NullableBool

Author

Gets or sets a value of Author.

[EntityField]
public string Author { get; set; }

Property Value

string

AutoAddNewResourcesAndTasks

Gets or sets a value indicating whether AutoAddNewResourcesAndTasks is set or not.

[EntityField]
public NullableBool AutoAddNewResourcesAndTasks { get; set; }

Property Value

NullableBool

AutoCalculateAssignmentCosts

Gets or sets whether assignment cost and remaining cost should be auto calculated using assignment’s work and resource rates.

[EntityField]
public bool AutoCalculateAssignmentCosts { get; set; }

Property Value

bool

Autolink

Gets or sets a value indicating whether Autolink is set or not.

[EntityField]
public NullableBool Autolink { get; set; }

Property Value

NullableBool

BaselineForEarnedValue

Gets or sets a value of BaselineForEarnedValue.

[EntityField]
public BaselineType BaselineForEarnedValue { get; set; }

Property Value

BaselineType

BuiltInProps

Gets project’s built-in properties collection.

public BuiltInProjectPropertyCollection BuiltInProps { get; }

Property Value

BuiltInProjectPropertyCollection

CalculationMode

Gets or sets calculation mode of a project. Can be one of the values of Aspose.Tasks.Project.CalculationMode enumeration.

public CalculationMode CalculationMode { get; set; }

Property Value

CalculationMode

Calendar

Gets or sets a value of Calendar.

[EntityField]
public Calendar Calendar { get; set; }

Property Value

Calendar

Calendars

Gets Aspose.Tasks.CalendarCollection object of this Project instance.

public CalendarCollection Calendars { get; }

Property Value

CalendarCollection

Category

Gets or sets a value of Category.

[EntityField]
public string Category { get; set; }

Property Value

string

Comments

Gets or sets a value of Comments.

[EntityField]
public string Comments { get; set; }

Property Value

string

Company

Gets or sets a value of Company.

[EntityField]
public string Company { get; set; }

Property Value

string

CreationDate

Gets or sets a value of CreationDate.

[EntityField]
public DateTime CreationDate { get; set; }

Property Value

DateTime

CriticalPath

Gets a collection which contains a list of Critical tasks which comprise Critical Path of this project. This is an O(n) operation, where n is the number of tasks in the project.

public TaskCollection CriticalPath { get; }

Property Value

TaskCollection

CriticalSlackLimit

Gets or sets a value of CriticalSlackLimit.

[EntityField]
public int CriticalSlackLimit { get; set; }

Property Value

int

CurrencyCode

Gets or sets a value of CurrencyCode.

[EntityField]
public string CurrencyCode { get; set; }

Property Value

string

CurrencyDigits

Gets or sets a value of CurrencyDigits.

[EntityField]
public int CurrencyDigits { get; set; }

Property Value

int

CurrencySymbol

Gets or sets a value of CurrencySymbol.

[EntityField]
public string CurrencySymbol { get; set; }

Property Value

string

CurrencySymbolPosition

Gets or sets a value of CurrencySymbolPosition.

[EntityField]
public CurrencySymbolPositionType CurrencySymbolPosition { get; set; }

Property Value

CurrencySymbolPositionType

CurrentDate

Gets or sets a value of CurrentDate.

[EntityField]
public DateTime CurrentDate { get; set; }

Property Value

DateTime

CustomDateFormat

Gets or sets a value of CustomDateFormat.

[EntityField]
public string CustomDateFormat { get; set; }

Property Value

string

CustomProps

Gets project’s custom properties collection.

public CustomProjectPropertyCollection CustomProps { get; }

Property Value

CustomProjectPropertyCollection

DateFormat

Gets or sets a value of DateFormat.

[EntityField]
public DateFormat DateFormat { get; set; }

Property Value

DateFormat

DaysPerMonth

Gets or sets a value of DaysPerMonth.

[EntityField]
public int DaysPerMonth { get; set; }

Property Value

int

DefaultFinishTime

Gets or sets a value of DefaultFinishTime.

[EntityField]
public DateTime DefaultFinishTime { get; set; }

Property Value

DateTime

DefaultFixedCostAccrual

Gets or sets a value of DefaultFixedCostAccrual.

[EntityField]
public CostAccrualType DefaultFixedCostAccrual { get; set; }

Property Value

CostAccrualType

DefaultOvertimeRate

Gets or sets a value of DefaultOvertimeRate.

[EntityField]
public double DefaultOvertimeRate { get; set; }

Property Value

double

DefaultStandardRate

Gets or sets a value of DefaultStandardRate.

[EntityField]
public double DefaultStandardRate { get; set; }

Property Value

double

DefaultStartTime

Gets or sets a value of DefaultStartTime.

[EntityField]
public DateTime DefaultStartTime { get; set; }

Property Value

DateTime

DefaultTaskEVMethod

Gets or sets a value of DefaultTaskEVMethod.

[EntityField]
public EarnedValueMethodType DefaultTaskEVMethod { get; set; }

Property Value

EarnedValueMethodType

DefaultTaskType

Gets or sets a value of DefaultTaskType.

[EntityField]
public TaskType DefaultTaskType { get; set; }

Property Value

TaskType

DefaultView

Gets or sets default view of the project.

public View DefaultView { get; set; }

Property Value

View

DefaultWeekWorkingDays

Gets the instance of Aspose.Tasks.WeekDayCollection class which represents a collection of project default week working days and working times.

public WeekDayCollection DefaultWeekWorkingDays { get; }

Property Value

WeekDayCollection

Remarks

The data contains only in mpp files (not in xml).

DisplayOptions

Gets an instance of the Aspose.Tasks.ProjectDisplayOptions class.

public ProjectDisplayOptions DisplayOptions { get; }

Property Value

ProjectDisplayOptions

DurationFormat

Gets or sets a value of DurationFormat.

[EntityField]
public TimeUnitType DurationFormat { get; set; }

Property Value

TimeUnitType

EarnedValueMethod

Gets or sets a value of EarnedValueMethod.

[EntityField]
public EarnedValueMethodType EarnedValueMethod { get; set; }

Property Value

EarnedValueMethodType

ExtendedAttributes

Gets ExtendedAttributeDefinitionCollection object. The collection of extended attribute (custom fields) definitions associated with a project.

public ExtendedAttributeDefinitionCollection ExtendedAttributes { get; }

Property Value

ExtendedAttributeDefinitionCollection

ExtendedCreationDate

Gets or sets a value of ExtendedCreationDate.

[EntityField]
public DateTime ExtendedCreationDate { get; set; }

Property Value

DateTime

FinishDate

Gets or sets a value of FinishDate.

[EntityField]
public DateTime FinishDate { get; set; }

Property Value

DateTime

FiscalYearStart

Gets or sets a value indicating whether FiscalYearStart is set or not.

[EntityField]
public NullableBool FiscalYearStart { get; set; }

Property Value

NullableBool

FyStartDate

Gets or sets a value of FyStartDate.

[EntityField]
public Month FyStartDate { get; set; }

Property Value

Month

Guid

Gets or sets a value of Guid.

[EntityField]
public Guid Guid { get; set; }

Property Value

Guid

HonorConstraints

Gets or sets a value indicating whether HonorConstraints is set or not.

[EntityField]
public NullableBool HonorConstraints { get; set; }

Property Value

NullableBool

HyperlinkBase

Gets or sets a value of HyperlinkBase.

[EntityField]
public string HyperlinkBase { get; set; }

Property Value

string

InsertedProjectsLikeSummary

Gets or sets a value indicating whether InsertedProjectsLikeSummary is set or not.

[EntityField]
public NullableBool InsertedProjectsLikeSummary { get; set; }

Property Value

NullableBool

KeepTaskOnNearestWorkingTimeWhenMadeAutoScheduled

Gets or sets a value indicating whether KeepTaskOnNearestWorkingTimeWhenMadeAutoScheduled is set or not.

[EntityField]
public NullableBool KeepTaskOnNearestWorkingTimeWhenMadeAutoScheduled { get; set; }

Property Value

NullableBool

Keywords

Gets or sets a value of Keywords.

[EntityField]
public string Keywords { get; set; }

Property Value

string

LastAuthor

Gets or sets a value of LastAuthor.

[EntityField]
public string LastAuthor { get; set; }

Property Value

string

LastPrinted

Gets or sets a value of LastPrinted.

[EntityField]
public DateTime LastPrinted { get; set; }

Property Value

DateTime

LastSaved

Gets or sets a value of LastSaved.

[EntityField]
public DateTime LastSaved { get; set; }

Property Value

DateTime

Manager

Gets or sets a value of Manager.

[EntityField]
public string Manager { get; set; }

Property Value

string

MicrosoftProjectServerURL

Gets or sets a value indicating whether MicrosoftProjectServerURL is set or not.

[EntityField]
public NullableBool MicrosoftProjectServerURL { get; set; }

Property Value

NullableBool

MinutesPerDay

Gets or sets a value of MinutesPerDay.

[EntityField]
public int MinutesPerDay { get; set; }

Property Value

int

MinutesPerWeek

Gets or sets a value of MinutesPerWeek.

[EntityField]
public int MinutesPerWeek { get; set; }

Property Value

int

MoveCompletedEndsBack

Gets or sets a value indicating whether MoveCompletedEndsBack is set or not.

[EntityField]
public NullableBool MoveCompletedEndsBack { get; set; }

Property Value

NullableBool

MoveCompletedEndsForward

Gets or sets a value indicating whether MoveCompletedEndsForward is set or not.

[EntityField]
public NullableBool MoveCompletedEndsForward { get; set; }

Property Value

NullableBool

MoveRemainingStartsBack

Gets or sets a value indicating whether MoveRemainingStartsBack is set or not.

[EntityField]
public NullableBool MoveRemainingStartsBack { get; set; }

Property Value

NullableBool

MoveRemainingStartsForward

Gets or sets a value indicating whether MoveRemainingStartsForward is set or not.

[EntityField]
public NullableBool MoveRemainingStartsForward { get; set; }

Property Value

NullableBool

MultipleCriticalPaths

Gets or sets a value indicating whether MultipleCriticalPaths is set or not.

[EntityField]
public NullableBool MultipleCriticalPaths { get; set; }

Property Value

NullableBool

Name

Gets or sets a value of Name.

[EntityField]
public string Name { get; set; }

Property Value

string

NewTaskStartDate

Gets or sets a value of NewTaskStartDate.

[EntityField]
public TaskStartDateType NewTaskStartDate { get; set; }

Property Value

TaskStartDateType

NewTasksAreManual

Gets or sets a value indicating whether NewTasksAreManual is set or not.

[EntityField]
public NullableBool NewTasksAreManual { get; set; }

Property Value

NullableBool

NewTasksEffortDriven

Gets or sets a value indicating whether NewTasksEffortDriven is set or not.

[EntityField]
public NullableBool NewTasksEffortDriven { get; set; }

Property Value

NullableBool

NewTasksEstimated

Gets or sets a value indicating whether NewTasksEstimated is set or not.

[EntityField]
public NullableBool NewTasksEstimated { get; set; }

Property Value

NullableBool

OleObjects

Gets a collection containing the instances of the Aspose.Tasks.OleObject class which are linked or embedded to this project file. Available for mpp file format only. This collection is read-only except for ‘Clear’ operation.

public OleObjectCollection OleObjects { get; }

Property Value

OleObjectCollection

OutlineCodes

Gets OutlineCodeDefinitionCollection object. The collection of outline code definitions associated with a project.

public OutlineCodeDefinitionCollection OutlineCodes { get; }

Property Value

OutlineCodeDefinitionCollection

PrimaveraProperties

Gets an object containing Primavera-specific properties for a project read from Primavera file.

public PrimaveraProjectProperties PrimaveraProperties { get; }

Property Value

PrimaveraProjectProperties

ProjectExternallyEdited

Gets or sets a value indicating whether ProjectExternallyEdited is set or not.

[EntityField]
public NullableBool ProjectExternallyEdited { get; set; }

Property Value

NullableBool

RemoveFileProperties

Gets or sets a value indicating whether RemoveFileProperties is set or not.

[EntityField]
public NullableBool RemoveFileProperties { get; set; }

Property Value

NullableBool

ResourceAssignments

Gets ResourceAssignmentCollection object.

public ResourceAssignmentCollection ResourceAssignments { get; }

Property Value

ResourceAssignmentCollection

ResourceFilters

Gets all the resource-based filter definitions. ResourceFilters is a collection of Aspose.Tasks.Filter objects.

public FilterCollection ResourceFilters { get; }

Property Value

FilterCollection

ResourceGroups

Gets all of the resource-based group definitions. ResourceGroups is a collection of Aspose.Tasks.Group objects.

public GroupCollection ResourceGroups { get; }

Property Value

GroupCollection

Resources

Gets ResourceCollection object.

public ResourceCollection Resources { get; }

Property Value

ResourceCollection

Revision

Gets or sets a value of Revision.

[EntityField]
public int Revision { get; set; }

Property Value

int

RootTask

Gets the root of the tree of tasks.

public Task RootTask { get; }

Property Value

Task

SaveVersion

Gets or sets a value of SaveVersion.

[EntityField]
public int SaveVersion { get; set; }

Property Value

int

ScheduleFromStart

Gets or sets a value indicating whether ScheduleFromStart is set or not.

[EntityField]
public NullableBool ScheduleFromStart { get; set; }

Property Value

NullableBool

ShowProjectSummaryTask

Gets or sets a value indicating whether ShowProjectSummaryTask is set or not.

[EntityField]
public bool ShowProjectSummaryTask { get; set; }

Property Value

bool

SplitsInProgressTasks

Gets or sets a value indicating whether SplitsInProgressTasks is set or not.

[EntityField]
public NullableBool SplitsInProgressTasks { get; set; }

Property Value

NullableBool

SpreadActualCost

Gets or sets a value indicating whether SpreadActualCost is set or not.

[EntityField]
public NullableBool SpreadActualCost { get; set; }

Property Value

NullableBool

SpreadPercentComplete

Gets or sets a value indicating whether SpreadPercentComplete is set or not.

[EntityField]
public NullableBool SpreadPercentComplete { get; set; }

Property Value

NullableBool

StartDate

Gets or sets a value of StartDate.

[EntityField]
public DateTime StartDate { get; set; }

Property Value

DateTime

StatusDate

Gets or sets a value of StatusDate.

[EntityField]
public DateTime StatusDate { get; set; }

Property Value

DateTime

Subject

Gets or sets a value of Subject.

[EntityField]
public string Subject { get; set; }

Property Value

string

Tables

Gets a list of Aspose.Tasks.Table objects.

public TableCollection Tables { get; }

Property Value

TableCollection

TaskFilters

Gets all the task-based filter definitions. TaskFilters is a collection of Aspose.Tasks.Filter objects.

public FilterCollection TaskFilters { get; }

Property Value

FilterCollection

TaskGroups

Gets all the task-based group definitions. TaskGroups is a collection of Aspose.Tasks.Group objects.

public GroupCollection TaskGroups { get; }

Property Value

GroupCollection

TaskLinks

Gets Aspose.Tasks.TaskLinkCollection object.

public TaskLinkCollection TaskLinks { get; }

Property Value

TaskLinkCollection

TaskUpdatesResource

Gets or sets a value indicating whether TaskUpdatesResource is set or not.

[EntityField]
public NullableBool TaskUpdatesResource { get; set; }

Property Value

NullableBool

Template

Gets or sets a value of Template.

[EntityField]
public string Template { get; set; }

Property Value

string

TimescaleFinish

Gets or sets a value of TimescaleFinish.

[EntityField]
public DateTime TimescaleFinish { get; set; }

Property Value

DateTime

TimescaleStart

Gets or sets a value of TimescaleStart.

[EntityField]
public DateTime TimescaleStart { get; set; }

Property Value

DateTime

Title

Gets or sets a value of Title.

[EntityField]
public string Title { get; set; }

Property Value

string

Uid

Gets or sets a value of Uid.

[EntityField]
public string Uid { get; set; }

Property Value

string

UpdateManuallyScheduledTasksWhenEditingLinks

Gets or sets a value indicating whether UpdateManuallyScheduledTasksWhenEditingLinks is set or not.

[EntityField]
public NullableBool UpdateManuallyScheduledTasksWhenEditingLinks { get; set; }

Property Value

NullableBool

VbaProject

Gets an instance of Aspose.Tasks.Project.VbaProject class.

public VbaProject VbaProject { get; }

Property Value

VbaProject

Views

Gets a list of Aspose.Tasks.View objects.

public ViewCollection Views { get; }

Property Value

ViewCollection

WBSCodeDefinition

Gets or sets WBS Code Definition for the project.

public WBSCodeDefinition WBSCodeDefinition { get; set; }

Property Value

WBSCodeDefinition

WeekStartDay

Gets or sets a value of WeekStartDay.

[EntityField]
public DayType WeekStartDay { get; set; }

Property Value

DayType

WorkFormat

Gets or sets a value of WorkFormat.

[EntityField]
public TimeUnitType WorkFormat { get; set; }

Property Value

TimeUnitType

Methods

CopyTo(Project)

Copies project’s main data and properties to another project.

public void CopyTo(Project another)

Parameters

another Project

Another project to copy data to.

CopyTo(Project, CopyToOptions)

Copies project’s main data and properties to another project.

public void CopyTo(Project another, CopyToOptions options)

Parameters

another Project

Another project to copy data to.

options CopyToOptions

Copy options to control copy process.

EnumerateAllChildTasks()

Recursively enumerates all project’s tasks including root task.

public IEnumerable<task> EnumerateAllChildTasks()

Returns

IEnumerable<Task&gt;

IEnumerable which can be used to iterate over all project’s tasks.

Remarks

Provides a more lightweight way to iterate over tasks compared to Aspose.Tasks.Project.SelectAllChildTasks method as it does not allocate memory for all tasks.

Get<t>(Key<t, prjkey="">)

Returns the value to which the property is mapped in this container.

public T Get<t>(Key<t, prjkey=""> key)

Parameters

key Key<t, prjkey="">

the specified property key. Aspose.Tasks.Prj for getting the property key.

Returns

T

the value to which the property is mapped in this container.

Type Parameters

T

the type of the mapped value.

GetBaselineSaveTime(BaselineType)

Returns the baseline save time.

public DateTime GetBaselineSaveTime(BaselineType baselineNumber)

Parameters

baselineNumber BaselineType

The baseline’s number Aspose.Tasks.BaselineType.

Returns

DateTime

The baseline’s last save date and time.

Remarks

Returns DateTime.MinValue if the baseline was not saved.

GetDuration(double)

Gets Aspose.Tasks.Duration object with the specified number of units and default duration format which is defined in project’s settings Aspose.Tasks.Prj.DurationFormat.

public Duration GetDuration(double val)

Parameters

val double

specified number of units.

Returns

Duration

Duration object.

Remarks

This method should be used carefully because it returns different durations depending on Project.DurationFormat setting. For example, GetWork(1.0) will return 1 hour when Project.DurationFormat is TimeUnitType.Hour or 1 day if Project.DurationFormat is TimeUnitType.Day.

GetDuration(double, TimeUnitType)

Gets Aspose.Tasks.Duration object with the specified number of Aspose.Tasks.TimeUnitType units.

public Duration GetDuration(double val, TimeUnitType timeUnit)

Parameters

val double

specified number of units.

timeUnit TimeUnitType

specified TimeUnitType value.

Returns

Duration

Duration object.

GetDuration(TimeSpan, TimeUnitType)

Gets Aspose.Tasks.Duration object with the specified System.TimeSpan value and specified Aspose.Tasks.TimeUnitType value.

public Duration GetDuration(TimeSpan timeSpan, TimeUnitType timeUnit)

Parameters

timeSpan TimeSpan

specified System.TimeSpan value.

timeUnit TimeUnitType

specified TimeUnitType value.

Returns

Duration

Duration object.

GetPageCount(SaveOptions)

Returns page count for the project to be rendered using given Aspose.Tasks.Saving.SaveOptions.

public int GetPageCount(SaveOptions saveOptions)

Parameters

saveOptions SaveOptions

The save options to get page count for.

Returns

int

a page count to be rendered.

Examples

In this example instance of HtmlSaveOptions and the number of pages in resulting HTML is written to the console.

csharp
[C#]
Project project = new Project(@"test.mpp");
HtmlSaveOptions saveOptions = new HtmlSaveOptions
{
    IncludeProjectNameInPageHeader = false,
    IncludeProjectNameInTitle = false,
    PageSize = PageSize.A4,
    Timescale = Timescale.Days,
    StartDate = project.Get(Prj.StartDate).Date,
    EndDate = project.Get(Prj.FinishDate).Date
};

Console.WriteLine(project.GetPageCount(saveOptions));

GetPageCount()

Returns page count for the project to be rendered using default Aspose.Tasks.Visualization.Timescale(Days).

public int GetPageCount()

Returns

int

Page count to be rendered.

GetPageCount(Timescale)

Returns page count for the project to be rendered using given Aspose.Tasks.Visualization.Timescale.

public int GetPageCount(Timescale scale)

Parameters

scale Timescale

The scale to get page count for.

Returns

int

Page count to be rendered.

GetPageCount(PresentationFormat)

Returns page count for the project to be rendered using default Aspose.Tasks.Visualization.Timescale(Days) and given Aspose.Tasks.Visualization.PresentationFormat

public int GetPageCount(PresentationFormat format)

Parameters

format PresentationFormat

The format to get page count for.

Returns

int

Page count to be rendered.

GetPageCount(PresentationFormat, Timescale)

Returns page count for the project to be rendered using given Aspose.Tasks.Visualization.Timescale and Aspose.Tasks.Visualization.PresentationFormat.

public int GetPageCount(PresentationFormat format, Timescale scale)

Parameters

format PresentationFormat

The format to get page count for.

scale Timescale

The scale to get page count for.

Returns

int

a page count to be rendered.

GetPageCount(PageSize, Timescale, DateTime, DateTime)

Returns page count for the project to be rendered using given Aspose.Tasks.Visualization.Timescale, Aspose.Tasks.Visualization.PresentationFormat and date range.

public int GetPageCount(PageSize pageSize, Timescale scale, DateTime startDate, DateTime endDate)

Parameters

pageSize PageSize

The size to get page count for.

scale Timescale

The scale to get page count for.

startDate DateTime

The start date to get page count for.

endDate DateTime

The end date to get page count for.

Returns

int

Page count to be rendered.

GetPageCount(PageSize, Timescale)

Returns page count for the project to be rendered using given Aspose.Tasks.Visualization.Timescale and Aspose.Tasks.Visualization.PageSize.

public int GetPageCount(PageSize pageSize, Timescale scale)

Parameters

pageSize PageSize

The size to get page count for.

scale Timescale

The scale to get page count for.

Returns

int

Page count to be rendered.

GetPredecessors(Task)

Returns a collection of task links which are predecessors of the specified task.

public TaskLinkCollection GetPredecessors(Task task)

Parameters

task Task

The task to get predecessors for.

Returns

TaskLinkCollection

List of predecessors Aspose.Tasks.TaskLink.

GetProjectFileInfo(string)

Read project file info from the file.

public static ProjectFileInfo GetProjectFileInfo(string filename)

Parameters

filename string

The project filename.

Returns

ProjectFileInfo

The project file info Aspose.Tasks.ProjectFileInfo.

GetProjectFileInfo(Stream)

Gets project file info from the stream.

public static ProjectFileInfo GetProjectFileInfo(Stream stream)

Parameters

stream Stream

The data stream.

Returns

ProjectFileInfo

The project file info Aspose.Tasks.ProjectFileInfo.

GetWork(double)

Gets Aspose.Tasks.Duration object with the specified System.Double value and default work format.

public Duration GetWork(double val)

Parameters

val double

specified double value.

Returns

Duration

Duration object.

Remarks

This method should be used carefully because it returns different durations depending on Project.WorkFormat setting. For example, GetWork(1.0) will return 1 hour when Project.WorkFormat is TimeUnitType.Hour or 1 day if Project.WorkFormat is TimeUnitType.Day.

Print()

Prints project to the default printer with default printer settings using the standard (no User Interface) print controller.

public void Print()

Print(PrintOptions)

Prints project to the default printer with default printer settings and custom save options using the standard (no User Interface) print controller.

public void Print(PrintOptions options)

Parameters

options PrintOptions

the specified instance of the Aspose.Tasks.Saving.PrintOptions class.

Print(string)

Prints project to the specified printer with default printer settings using the standard (no User Interface) print controller.

public void Print(string printerName)

Parameters

printerName string

Specified printer name.

Print(PrinterSettings)

Prints project according to the specified printer settings using the standard (no User Interface) print controller.

public void Print(PrinterSettings printerSettings)

Parameters

printerSettings PrinterSettings

the specified instance of the System.Drawing.Printing.PrinterSettings class.

Print(PrinterSettings, string)

Prints project according to the specified printer settings using the standard (no User Interface) print controller.

public void Print(PrinterSettings printerSettings, string documentName)

Parameters

printerSettings PrinterSettings

the specified instance of the System.Drawing.Printing.PrinterSettings class.

documentName string

the document name to display (for example, in a print status dialog box or printer queue).

Print(PrinterSettings, PrintOptions)

Prints project according to the specified printer settings and custom save options using the standard (no User Interface) print controller.

public void Print(PrinterSettings printerSettings, PrintOptions options)

Parameters

printerSettings PrinterSettings

the specified instance of the System.Drawing.Printing.PrinterSettings class.

options PrintOptions

the specified instance of the Aspose.Tasks.Saving.PrintOptions class.

Print(PrinterSettings, PrintOptions, string)

Prints project according to the specified printer settings, custom save options and the specified document name using the standard (no User Interface) print controller.

public void Print(PrinterSettings printerSettings, PrintOptions options, string documentName)

Parameters

printerSettings PrinterSettings

the specified instance of the System.Drawing.Printing.PrinterSettings class.

options PrintOptions

the specified instance of the Aspose.Tasks.Saving.PrintOptions class.

documentName string

the document name to display (for example, in a print status dialog box or printer queue).

Recalculate()

Reschedules all project tasks ids, outline levels, start/finish dates, sets early/late dates, calculates slacks, work and cost fields.

public void Recalculate()

Recalculate(bool)

Reschedules all project tasks ids, outline levels, start/finish dates, sets early/late dates, calculates slacks, work and cost fields with optional validation.

public void Recalculate(bool validate)

Parameters

validate bool

If true the validation of recalculation will be performed. What data is validated: At the moment only basic validation of task and task link date ranges is implemented. Task’s date ranges (e.g. ActualStart - ActualFinish, EarlyStart - EarlyFinish, etc.) as well as Task Links dates will be checked against the date criteria that start date is less or equal than finish date. If any of conditions described above is failed then Aspose.Tasks.RecalculationValidationException will be thrown.

RecalculateResourceFields()

Recalculates Id, Start and Finish of resources.

public void RecalculateResourceFields()

RecalculateResourceStartFinish()

Recalculates Start and Finish of resources.

public void RecalculateResourceStartFinish()

RemoveInvalidResourceAssignments()

Eliminates invalid resource assignments from the project resource assignments list.

public void RemoveInvalidResourceAssignments()

Remarks

MS Project creates an empty resource assignment for each task. Call the method to remove them.

RenumberWBSCode()

Renumber WBS code of all tasks.

public void RenumberWBSCode()

RenumberWBSCode(List<int>)

Renumber WBS code of passed tasks.

public void RenumberWBSCode(List<int> taskIds)

Parameters

taskIds List<int&gt;

Task identifiers to renumber WBS codes.

RescheduleUncompletedWorkToStartAfter(DateTime)

Reschedules uncompleted project work to start after a specified date.

public void RescheduleUncompletedWorkToStartAfter(DateTime after)

Parameters

after DateTime

The date to reschedule uncompleted work after.

Remarks

Ensure that Project.CanSplitsInProgressTasks flag is set to true before using this method.

RescheduleUncompletedWorkToStartAfter(DateTime, List<task>)

Reschedules uncompleted work for a specified list of tasks to start after a specified date.

public void RescheduleUncompletedWorkToStartAfter(DateTime after, List<task> taskCollection)

Parameters

after DateTime

The date to reschedule uncompleted work after.

taskCollection List<Task&gt;

List<Task> of tasks to reschedule uncompleted work for.

Remarks

Ensure that Project.CanSplitsInProgressTasks flag is set to true before using this method.

Save(string, SimpleSaveOptions)

Saves the document to a file using the specified save options.

public void Save(string filename, SimpleSaveOptions options)

Parameters

filename string

The file name.

options SimpleSaveOptions

The save options.

Save(string, SaveFileFormat)

Saves the project data to the file.

public void Save(string filename, SaveFileFormat format)

Parameters

filename string

The file name.

format SaveFileFormat

The save file format.

Save(string)

Saves the project data to the file in mpp format.

public void Save(string filename)

Parameters

filename string

The file name.

Save(Stream, SimpleSaveOptions)

Saves the project to a stream using the specified save options.

public void Save(Stream stream, SimpleSaveOptions options)

Parameters

stream Stream

The stream.

options SimpleSaveOptions

The save options.

Save(Stream, SaveFileFormat)

Saves the project data to the stream.

public void Save(Stream stream, SaveFileFormat format)

Parameters

stream Stream

The stream.

format SaveFileFormat

the specified save file format.Aspose.Tasks.Saving.SaveFileFormat

SaveAsTemplate(string, SaveTemplateOptions)

Saves the project as a template.

public void SaveAsTemplate(string fileName, SaveTemplateOptions options)

Parameters

fileName string

The file name.

options SaveTemplateOptions

the specified save options Aspose.Tasks.Saving.SaveTemplateOptions.

SaveAsTemplate(string)

Saves the project as a template to the specified file path.

public void SaveAsTemplate(string fileName)

Parameters

fileName string

the specified file name.

SaveAsTemplate(Stream)

Saves the project as a template to a specified stream.

public void SaveAsTemplate(Stream stream)

Parameters

stream Stream

the specified stream to save the project to.

SaveAsTemplate(Stream, SaveTemplateOptions)

Saves the project as a template to a specified stream.

public void SaveAsTemplate(Stream stream, SaveTemplateOptions options)

Parameters

stream Stream

Stream to save the project template to.

options SaveTemplateOptions

the specified save options Aspose.Tasks.Saving.SaveTemplateOptions.

SaveReport(Stream)

Saves the project overview report to the stream.

public void SaveReport(Stream stream)

Parameters

stream Stream

The stream to save project report to.

SaveReport(string)

Saves the project overview report to PDF file.

public void SaveReport(string fileName)

Parameters

fileName string

The file name.

SaveReport(Stream, ReportType)

Saves the project report of the specified type to the specified stream.

public void SaveReport(Stream stream, ReportType reportType)

Parameters

stream Stream

the specified stream to save project report to.

reportType ReportType

the specified report type.Aspose.Tasks.Visualization.ReportType

SaveReport(string, ReportType)

Saves the project report of the specified type in PDF format to the specified file path.

public void SaveReport(string fileName, ReportType reportType)

Parameters

fileName string

the specified file name.

reportType ReportType

the specified report type.Aspose.Tasks.Visualization.ReportType

SelectAllChildTasks()

Recursively collects all child tasks of the root task.

public IEnumerable<task> SelectAllChildTasks()

Returns

IEnumerable<Task&gt;

The collection of tasks.

Set<t>(Key<t, prjkey="">, T)

Maps the specified property to the specified value in this container.

public void Set<t>(Key<t, prjkey=""> key, T val)

Parameters

key Key<t, prjkey="">

the specified property key. Aspose.Tasks.Prj for getting the property key.

val T

the value.

Type Parameters

T

the type of the mapped value.

Set(Key<datetime, prjkey="">, DateTime)

Maps the specified property to the specified value in this container.

public void Set(Key<datetime, prjkey=""> key, DateTime val)

Parameters

key Key<DateTime, PrjKey&gt;

the specified property key. Aspose.Tasks.Prj for getting the property key.

val DateTime

the value.

SetBaseline(BaselineType)

Saves baseline fields to the specified baseline for the entire project.

public void SetBaseline(BaselineType baselineType)

Parameters

baselineType BaselineType

The baseline type to save baseline data to.

SetBaseline(BaselineType, IEnumerable<task>)

Saves baseline fields to the specified baseline for the selected tasks.

public void SetBaseline(BaselineType baselineType, IEnumerable<task> taskCollection)

Parameters

baselineType BaselineType

The baseline type to save baseline data to.

taskCollection IEnumerable<Task&gt;

List of tasks to save baseline data for.

SetBaselineSaveTime(BaselineType, DateTime)

Sets the baseline save time.

public void SetBaselineSaveTime(BaselineType baselineNumber, DateTime value)

Parameters

baselineNumber BaselineType

The baseline’s number Aspose.Tasks.BaselineType.

value DateTime

The baseline’s last save date and time.

Remarks

Set value to DateTime.MinValue if the baseline was not saved.

UpdateProjectWorkAsComplete(DateTime, bool)

Updates all work as complete through a specified date for the entire project.

public void UpdateProjectWorkAsComplete(DateTime completeThrough, bool setZeroOrHundredPercentCompleteOnly)

Parameters

completeThrough DateTime

The date to update work as completed through.

setZeroOrHundredPercentCompleteOnly bool

If set to true updates only those tasks as 100% complete whose finish date is before specified complete-through date. Otherwise, calculates a percentage complete value based on scheduled start and complete-through dates.

UpdateProjectWorkAsComplete(DateTime, bool, List<task>)

Updates all work as complete through a specified date for the specified list of tasks.

public void UpdateProjectWorkAsComplete(DateTime completeThrough, bool setZeroOrHundredPercentCompleteOnly, List<task> taskCollection)

Parameters

completeThrough DateTime

The date to update work as completed through.

setZeroOrHundredPercentCompleteOnly bool

If set to true updates only those tasks as 100% complete whose finish date is before specified complete-through date. Otherwise, calculates a percentage complete value based on scheduled start and complete-through dates.

taskCollection List<Task&gt;

List<Task> of tasks to update work for. </task></task></datetime,></datetime,></t,></t,></t,></t></task></int></t,></t,></t,></t>