Class Project
Namespace: Aspose.Tasks
Assembly: Aspose.Tasks.dll (25.2.0)
Represents a project.
public class Project
Inheritance
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
AdminProject
Gets or sets a value indicating whether AdminProject is set or not.
[EntityField]
public NullableBool AdminProject { get; set; }
Property Value
AreEditableActualCosts
Gets or sets a value indicating whether AreEditableActualCosts is set or not.
[EntityField]
public NullableBool AreEditableActualCosts { get; set; }
Property Value
Author
Gets or sets a value of Author.
[EntityField]
public string Author { get; set; }
Property Value
AutoAddNewResourcesAndTasks
Gets or sets a value indicating whether AutoAddNewResourcesAndTasks is set or not.
[EntityField]
public NullableBool AutoAddNewResourcesAndTasks { get; set; }
Property Value
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
Autolink
Gets or sets a value indicating whether Autolink is set or not.
[EntityField]
public NullableBool Autolink { get; set; }
Property Value
BaselineForEarnedValue
Gets or sets a value of BaselineForEarnedValue.
[EntityField]
public BaselineType BaselineForEarnedValue { get; set; }
Property Value
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
Calendar
Gets or sets a value of Calendar.
[EntityField]
public Calendar Calendar { get; set; }
Property Value
Calendars
Gets Aspose.Tasks.CalendarCollection object of this Project instance.
public CalendarCollection Calendars { get; }
Property Value
Category
Gets or sets a value of Category.
[EntityField]
public string Category { get; set; }
Property Value
Comments
Gets or sets a value of Comments.
[EntityField]
public string Comments { get; set; }
Property Value
Company
Gets or sets a value of Company.
[EntityField]
public string Company { get; set; }
Property Value
CreationDate
Gets or sets a value of CreationDate.
[EntityField]
public DateTime CreationDate { get; set; }
Property Value
CriticalPath
Gets a collection which contains a list of Critical tasks which comprise Critical Path of this project.
public TaskCollection CriticalPath { get; }
Property Value
CriticalSlackLimit
Gets or sets a value of CriticalSlackLimit.
[EntityField]
public int CriticalSlackLimit { get; set; }
Property Value
CurrencyCode
Gets or sets a value of CurrencyCode.
[EntityField]
public string CurrencyCode { get; set; }
Property Value
CurrencyDigits
Gets or sets a value of CurrencyDigits.
[EntityField]
public int CurrencyDigits { get; set; }
Property Value
CurrencySymbol
Gets or sets a value of CurrencySymbol.
[EntityField]
public string CurrencySymbol { get; set; }
Property Value
CurrencySymbolPosition
Gets or sets a value of CurrencySymbolPosition.
[EntityField]
public CurrencySymbolPositionType CurrencySymbolPosition { get; set; }
Property Value
CurrentDate
Gets or sets a value of CurrentDate.
[EntityField]
public DateTime CurrentDate { get; set; }
Property Value
CustomDateFormat
Gets or sets a value of CustomDateFormat.
[EntityField]
public string CustomDateFormat { get; set; }
Property Value
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
DaysPerMonth
Gets or sets a value of DaysPerMonth.
[EntityField]
public int DaysPerMonth { get; set; }
Property Value
DefaultFinishTime
Gets or sets a value of DefaultFinishTime.
[EntityField]
public DateTime DefaultFinishTime { get; set; }
Property Value
DefaultFixedCostAccrual
Gets or sets a value of DefaultFixedCostAccrual.
[EntityField]
public CostAccrualType DefaultFixedCostAccrual { get; set; }
Property Value
DefaultOvertimeRate
Gets or sets a value of DefaultOvertimeRate.
[EntityField]
public double DefaultOvertimeRate { get; set; }
Property Value
DefaultStandardRate
Gets or sets a value of DefaultStandardRate.
[EntityField]
public double DefaultStandardRate { get; set; }
Property Value
DefaultStartTime
Gets or sets a value of DefaultStartTime.
[EntityField]
public DateTime DefaultStartTime { get; set; }
Property Value
DefaultTaskEVMethod
Gets or sets a value of DefaultTaskEVMethod.
[EntityField]
public EarnedValueMethodType DefaultTaskEVMethod { get; set; }
Property Value
DefaultTaskType
Gets or sets a value of DefaultTaskType.
[EntityField]
public TaskType DefaultTaskType { get; set; }
Property Value
DefaultView
Gets or sets default view of the project.
public View DefaultView { get; set; }
Property Value
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
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
DurationFormat
Gets or sets a value of DurationFormat.
[EntityField]
public TimeUnitType DurationFormat { get; set; }
Property Value
EarnedValueMethod
Gets or sets a value of EarnedValueMethod.
[EntityField]
public EarnedValueMethodType EarnedValueMethod { get; set; }
Property Value
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
FinishDate
Gets or sets a value of FinishDate.
[EntityField]
public DateTime FinishDate { get; set; }
Property Value
FiscalYearStart
Gets or sets a value indicating whether FiscalYearStart is set or not.
[EntityField]
public NullableBool FiscalYearStart { get; set; }
Property Value
FyStartDate
Gets or sets a value of FyStartDate.
[EntityField]
public Month FyStartDate { get; set; }
Property Value
Guid
Gets or sets a value of Guid.
[EntityField]
public Guid Guid { get; set; }
Property Value
HonorConstraints
Gets or sets a value indicating whether HonorConstraints is set or not.
[EntityField]
public NullableBool HonorConstraints { get; set; }
Property Value
HyperlinkBase
Gets or sets a value of HyperlinkBase.
[EntityField]
public string HyperlinkBase { get; set; }
Property Value
InsertedProjectsLikeSummary
Gets or sets a value indicating whether InsertedProjectsLikeSummary is set or not.
[EntityField]
public NullableBool InsertedProjectsLikeSummary { get; set; }
Property Value
KeepTaskOnNearestWorkingTimeWhenMadeAutoScheduled
Gets or sets a value indicating whether KeepTaskOnNearestWorkingTimeWhenMadeAutoScheduled is set or not.
[EntityField]
public NullableBool KeepTaskOnNearestWorkingTimeWhenMadeAutoScheduled { get; set; }
Property Value
Keywords
Gets or sets a value of Keywords.
[EntityField]
public string Keywords { get; set; }
Property Value
LastAuthor
Gets or sets a value of LastAuthor.
[EntityField]
public string LastAuthor { get; set; }
Property Value
LastPrinted
Gets or sets a value of LastPrinted.
[EntityField]
public DateTime LastPrinted { get; set; }
Property Value
LastSaved
Gets or sets a value of LastSaved.
[EntityField]
public DateTime LastSaved { get; set; }
Property Value
Manager
Gets or sets a value of Manager.
[EntityField]
public string Manager { get; set; }
Property Value
MicrosoftProjectServerURL
Gets or sets a value indicating whether MicrosoftProjectServerURL is set or not.
[EntityField]
public NullableBool MicrosoftProjectServerURL { get; set; }
Property Value
MinutesPerDay
Gets or sets a value of MinutesPerDay.
[EntityField]
public int MinutesPerDay { get; set; }
Property Value
MinutesPerWeek
Gets or sets a value of MinutesPerWeek.
[EntityField]
public int MinutesPerWeek { get; set; }
Property Value
MoveCompletedEndsBack
Gets or sets a value indicating whether MoveCompletedEndsBack is set or not.
[EntityField]
public NullableBool MoveCompletedEndsBack { get; set; }
Property Value
MoveCompletedEndsForward
Gets or sets a value indicating whether MoveCompletedEndsForward is set or not.
[EntityField]
public NullableBool MoveCompletedEndsForward { get; set; }
Property Value
MoveRemainingStartsBack
Gets or sets a value indicating whether MoveRemainingStartsBack is set or not.
[EntityField]
public NullableBool MoveRemainingStartsBack { get; set; }
Property Value
MoveRemainingStartsForward
Gets or sets a value indicating whether MoveRemainingStartsForward is set or not.
[EntityField]
public NullableBool MoveRemainingStartsForward { get; set; }
Property Value
MultipleCriticalPaths
Gets or sets a value indicating whether MultipleCriticalPaths is set or not.
[EntityField]
public NullableBool MultipleCriticalPaths { get; set; }
Property Value
Name
Gets or sets a value of Name.
[EntityField]
public string Name { get; set; }
Property Value
NewTaskStartDate
Gets or sets a value of NewTaskStartDate.
[EntityField]
public TaskStartDateType NewTaskStartDate { get; set; }
Property Value
NewTasksAreManual
Gets or sets a value indicating whether NewTasksAreManual is set or not.
[EntityField]
public NullableBool NewTasksAreManual { get; set; }
Property Value
NewTasksEffortDriven
Gets or sets a value indicating whether NewTasksEffortDriven is set or not.
[EntityField]
public NullableBool NewTasksEffortDriven { get; set; }
Property Value
NewTasksEstimated
Gets or sets a value indicating whether NewTasksEstimated is set or not.
[EntityField]
public NullableBool NewTasksEstimated { get; set; }
Property Value
OleObjects
Gets a collection containing the instances of the Aspose.Tasks.OleObject class which are linked or embedded to this project file.
public OleObjectCollection OleObjects { get; }
Property Value
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
ProjectExternallyEdited
Gets or sets a value indicating whether ProjectExternallyEdited is set or not.
[EntityField]
public NullableBool ProjectExternallyEdited { get; set; }
Property Value
RemoveFileProperties
Gets or sets a value indicating whether RemoveFileProperties is set or not.
[EntityField]
public NullableBool RemoveFileProperties { get; set; }
Property Value
ResourceAssignments
Gets ResourceAssignmentCollection object.
public ResourceAssignmentCollection ResourceAssignments { get; }
Property Value
ResourceFilters
Gets all the resource-based filter definitions. ResourceFilters is a collection of Aspose.Tasks.Filter objects.
public FilterCollection ResourceFilters { get; }
Property Value
ResourceGroups
Gets all of the resource-based group definitions. ResourceGroups is a collection of Aspose.Tasks.Group objects.
public GroupCollection ResourceGroups { get; }
Property Value
Resources
Gets ResourceCollection object.
public ResourceCollection Resources { get; }
Property Value
Revision
Gets or sets a value of Revision.
[EntityField]
public int Revision { get; set; }
Property Value
RootTask
Gets the root of the tree of tasks.
public Task RootTask { get; }
Property Value
SaveVersion
Gets or sets a value of SaveVersion.
[EntityField]
public int SaveVersion { get; set; }
Property Value
ScheduleFromStart
Gets or sets a value indicating whether ScheduleFromStart is set or not.
[EntityField]
public NullableBool ScheduleFromStart { get; set; }
Property Value
ShowProjectSummaryTask
Gets or sets a value indicating whether ShowProjectSummaryTask is set or not.
[EntityField]
public bool ShowProjectSummaryTask { get; set; }
Property Value
SplitsInProgressTasks
Gets or sets a value indicating whether SplitsInProgressTasks is set or not.
[EntityField]
public NullableBool SplitsInProgressTasks { get; set; }
Property Value
SpreadActualCost
Gets or sets a value indicating whether SpreadActualCost is set or not.
[EntityField]
public NullableBool SpreadActualCost { get; set; }
Property Value
SpreadPercentComplete
Gets or sets a value indicating whether SpreadPercentComplete is set or not.
[EntityField]
public NullableBool SpreadPercentComplete { get; set; }
Property Value
StartDate
Gets or sets a value of StartDate.
[EntityField]
public DateTime StartDate { get; set; }
Property Value
StatusDate
Gets or sets a value of StatusDate.
[EntityField]
public DateTime StatusDate { get; set; }
Property Value
Subject
Gets or sets a value of Subject.
[EntityField]
public string Subject { get; set; }
Property Value
Tables
Gets a list of Aspose.Tasks.Table objects.
public TableCollection Tables { get; }
Property Value
TaskFilters
Gets all the task-based filter definitions. TaskFilters is a collection of Aspose.Tasks.Filter objects.
public FilterCollection TaskFilters { get; }
Property Value
TaskGroups
Gets all the task-based group definitions. TaskGroups is a collection of Aspose.Tasks.Group objects.
public GroupCollection TaskGroups { get; }
Property Value
TaskLinks
Gets Aspose.Tasks.TaskLinkCollection object.
public TaskLinkCollection TaskLinks { get; }
Property Value
TaskUpdatesResource
Gets or sets a value indicating whether TaskUpdatesResource is set or not.
[EntityField]
public NullableBool TaskUpdatesResource { get; set; }
Property Value
Template
Gets or sets a value of Template.
[EntityField]
public string Template { get; set; }
Property Value
TimescaleFinish
Gets or sets a value of TimescaleFinish.
[EntityField]
public DateTime TimescaleFinish { get; set; }
Property Value
TimescaleStart
Gets or sets a value of TimescaleStart.
[EntityField]
public DateTime TimescaleStart { get; set; }
Property Value
Title
Gets or sets a value of Title.
[EntityField]
public string Title { get; set; }
Property Value
Uid
Gets or sets a value of Uid.
[EntityField]
public string Uid { get; set; }
Property Value
UpdateManuallyScheduledTasksWhenEditingLinks
Gets or sets a value indicating whether UpdateManuallyScheduledTasksWhenEditingLinks is set or not.
[EntityField]
public NullableBool UpdateManuallyScheduledTasksWhenEditingLinks { get; set; }
Property Value
VbaProject
Gets an instance of Aspose.Tasks.Project.VbaProject class.
public VbaProject VbaProject { get; }
Property Value
Views
Gets a list of Aspose.Tasks.View objects.
public ViewCollection Views { get; }
Property Value
WBSCodeDefinition
Gets or sets WBS Code Definition for the project.
public WBSCodeDefinition WBSCodeDefinition { get; set; }
Property Value
WeekStartDay
Gets or sets a value of WeekStartDay.
[EntityField]
public DayType WeekStartDay { get; set; }
Property Value
WorkFormat
Gets or sets a value of WorkFormat.
[EntityField]
public TimeUnitType WorkFormat { get; set; }
Property Value
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>
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
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
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 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 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 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
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
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
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
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
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
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
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
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
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
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 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
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.
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>
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
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
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>
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.
List<Task> of tasks to update work for. </task></task></datetime,></datetime,></t,></t,></t,></t></task></int></t,></t,></t,></t>