SaveTemplateOptions Class

Allows to specify additional options when saving a project as a template.
Inheritance Hierarchy
SystemObject
  Aspose.Tasks.SavingSaveTemplateOptions

Namespace:  Aspose.Tasks.Saving
Assembly:  Aspose.Tasks (in Aspose.Tasks.dll) Version: 21.1
Syntax
public class SaveTemplateOptions

The SaveTemplateOptions type exposes the following members.

Constructors
  NameDescription
Public methodSaveTemplateOptions
Initializes a new instance of the SaveTemplateOptions class
Properties
  NameDescription
Public propertyCode exampleRemoveActualValues
Gets or sets a value indicating whether all actual values from a project template should be removed.
Public propertyCode exampleRemoveBaselineValues
Gets or sets a value indicating whether all baseline values from a project template should be removed.
Public propertyCode exampleRemoveFixedCosts
Gets or sets a value indicating whether all fixed costs from a project template should be removed.
Public propertyCode exampleRemoveResourceRates
Gets or sets a value indicating whether resource rates from a project template should be removed.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
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