Project.SaveAsTemplate
Contents
[
Hide
]SaveAsTemplate(string, SaveTemplateOptions)
Saves the project as a template.
public void SaveAsTemplate(string fileName, SaveTemplateOptions options)
Parameter | Type | Description |
---|---|---|
fileName | String | The file name. |
options | SaveTemplateOptions | the specified save options SaveTemplateOptions . |
Examples
Shows how to save project as a template.
var project = new Project(DataDir + "Project2.mpp");
var projectFileInfo = Project.GetProjectFileInfo(DataDir + "Project2.mpp");
if (FileFormat.MPP14 == projectFileInfo.ProjectFileFormat)
{
Console.WriteLine("Project file format is ok");
}
var options = new SaveTemplateOptions
{
RemoveActualValues = true,
RemoveBaselineValues = true
};
project.SaveAsTemplate(OutDir + "SaveProjectDataAsTemplate_out.mpt", options);
var templateFileInfo = Project.GetProjectFileInfo(OutDir + "SaveProjectDataAsTemplate_out.mpt");
if (FileFormat.MPT14 == templateFileInfo.ProjectFileFormat)
{
Console.WriteLine("Template FileFormat is ok");
}
See Also
- class SaveTemplateOptions
- class Project
- namespace Aspose.Tasks
- assembly Aspose.Tasks
SaveAsTemplate(string)
Saves the project as a template to the specified file path.
public void SaveAsTemplate(string fileName)
Parameter | Type | Description |
---|---|---|
fileName | String | the specified file name. |
Examples
Shows how to save project as a template.
var project = new Project(DataDir + "Project2.mpp");
var projectFileInfo = Project.GetProjectFileInfo(DataDir + "Project2.mpp");
if (FileFormat.MPP14 == projectFileInfo.ProjectFileFormat)
{
Console.WriteLine("Project file format is ok");
}
var options = new SaveTemplateOptions
{
RemoveActualValues = true,
RemoveBaselineValues = true
};
project.SaveAsTemplate(OutDir + "SaveProjectDataAsTemplate_out.mpt", options);
var templateFileInfo = Project.GetProjectFileInfo(OutDir + "SaveProjectDataAsTemplate_out.mpt");
if (FileFormat.MPT14 == templateFileInfo.ProjectFileFormat)
{
Console.WriteLine("Template FileFormat is ok");
}
See Also
- class Project
- namespace Aspose.Tasks
- assembly Aspose.Tasks
SaveAsTemplate(Stream)
Saves the project as a template to a specified stream.
public void SaveAsTemplate(Stream stream)
Parameter | Type | Description |
---|---|---|
stream | Stream | the specified stream to save the project to. |
Examples
Shows how to save project as a template.
var project = new Project(DataDir + "Project2.mpp");
var projectFileInfo = Project.GetProjectFileInfo(DataDir + "Project2.mpp");
if (FileFormat.MPP14 == projectFileInfo.ProjectFileFormat)
{
Console.WriteLine("Project file format is ok");
}
var options = new SaveTemplateOptions
{
RemoveActualValues = true,
RemoveBaselineValues = true
};
project.SaveAsTemplate(OutDir + "SaveProjectDataAsTemplate_out.mpt", options);
var templateFileInfo = Project.GetProjectFileInfo(OutDir + "SaveProjectDataAsTemplate_out.mpt");
if (FileFormat.MPT14 == templateFileInfo.ProjectFileFormat)
{
Console.WriteLine("Template FileFormat is ok");
}
See Also
- class Project
- namespace Aspose.Tasks
- assembly Aspose.Tasks
SaveAsTemplate(Stream, SaveTemplateOptions)
Saves the project as a template to a specified stream.
public void SaveAsTemplate(Stream stream, SaveTemplateOptions options)
Parameter | Type | Description |
---|---|---|
stream | Stream | Stream to save the project template to. |
options | SaveTemplateOptions | the specified save options SaveTemplateOptions . |
Examples
Shows how to save project as a template.
var project = new Project(DataDir + "Project2.mpp");
var projectFileInfo = Project.GetProjectFileInfo(DataDir + "Project2.mpp");
if (FileFormat.MPP14 == projectFileInfo.ProjectFileFormat)
{
Console.WriteLine("Project file format is ok");
}
var options = new SaveTemplateOptions
{
RemoveActualValues = true,
RemoveBaselineValues = true
};
project.SaveAsTemplate(OutDir + "SaveProjectDataAsTemplate_out.mpt", options);
var templateFileInfo = Project.GetProjectFileInfo(OutDir + "SaveProjectDataAsTemplate_out.mpt");
if (FileFormat.MPT14 == templateFileInfo.ProjectFileFormat)
{
Console.WriteLine("Template FileFormat is ok");
}
See Also
- class SaveTemplateOptions
- class Project
- namespace Aspose.Tasks
- assembly Aspose.Tasks