SaveTemplateOptions

SaveTemplateOptions class

Allows to specify additional options when saving a project as a template.

public class SaveTemplateOptions

Constructors

NameDescription
SaveTemplateOptions()The default constructor.

Properties

NameDescription
RemoveActualValues { get; set; }Gets or sets a value indicating whether all actual values from a project template should be removed.
RemoveBaselineValues { get; set; }Gets or sets a value indicating whether all baseline values from a project template should be removed.
RemoveFixedCosts { get; set; }Gets or sets a value indicating whether all fixed costs from a project template should be removed.
RemoveResourceRates { get; set; }Gets or sets a value indicating whether resource rates from a project template should be removed.

Examples

Shows how to save project as a template by using options.

var project = new Project(DataDir + "EstimatedMilestoneTasks.mpp");
var projectFileInfo = Project.GetProjectFileInfo(DataDir + "EstimatedMilestoneTasks.mpp");

Console.WriteLine("Project File Format: " + projectFileInfo.ProjectFileFormat);

// create template save options
// and tune its properties
var options = new SaveTemplateOptions
{
    // set a value indicating whether all fixed costs from a project template should be removed
    RemoveFixedCosts = true,

    // set a value indicating whether all actual values from a project template should be removed
    RemoveActualValues = true,

    // set a value indicating whether resource rates from a project template should be removed
    RemoveResourceRates = true,

    // set a value indicating whether all baseline values from a project template should be removed
    RemoveBaselineValues = true
};

project.SaveAsTemplate(OutDir + "SaveProjectDataAsTemplate_out.mpt", options);

var templateFileInfo = Project.GetProjectFileInfo(DataDir + "SaveProjectDataAsTemplate_out.mpt");
Console.WriteLine("Project File Format: " + templateFileInfo.ProjectFileFormat);

See Also