Project.CopyTo

CopyTo(Project)

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

public void CopyTo(Project another)
ParameterTypeDescription
anotherProjectAnother project to copy data to.

Examples

Shows how to copy the project data to another project.

var project = new Project(DataDir + "CopyToProjectEmpty.xml");
File.Copy(DataDir + "CopyToProjectEmpty.mpp", DataDir + "ProjectCopying_out.mpp", true);

var mppProject = new Project(DataDir + "ProjectCopying_out.mpp");

// skip copying of view data while copying common project data.
project.CopyTo(mppProject);

See Also


CopyTo(Project, CopyToOptions)

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

public void CopyTo(Project another, CopyToOptions options)
ParameterTypeDescription
anotherProjectAnother project to copy data to.
optionsCopyToOptionsCopy options to control copy process.

Examples

Shows how to copy the project with usage of <see cref=“Aspose.Tasks.CopyToOptions”/> instance.

var project = new Project(DataDir + "CopyToProjectEmpty.xml");
File.Copy(DataDir + "CopyToProjectEmpty.mpp", OutDir + "ProjectCopying_out.mpp", true);

var mppProject = new Project(OutDir + "ProjectCopying_out.mpp");

// skip copying of view data while copying common project data.
var options = new CopyToOptions
{
    CopyViewData = false
};
project.CopyTo(mppProject, options);

See Also