ProjectOperationsCopyProject Method |
Copy project to a new Cobra project.
Namespace: Cobra.WebService.ClientAPI.Application.FilesAssembly: Cobra.WebService.ClientAPI (in Cobra.WebService.ClientAPI.dll) Version: 8.7.700.3793 (8.7.0700.3793)
Syntaxpublic ServiceResult CopyProject(
CopyProjectServiceArguments copyProjectServiceArguments
)
Parameters
- copyProjectServiceArguments CopyProjectServiceArguments
- An instance of CopyProjectServiceArguments class that contains the options used to copying project to a new Cobra project.
Return Value
ServiceResultThe result of copying project to a new Cobra project.
Example
This sample shows how to copy project to a new Cobra project.
using Cobra.Model.WebService;
using Cobra.WebService.ClientAPI;
using Cobra.WebService.ClientAPI.Client;
using Cobra.WebService.ClientAPI.Application.Files;
.
.
.
CobraServices cobraServices = new CobraServices();
cobraServices.ServiceIdentityData.Username = "SYSADMIN";
cobraServices.ServiceIdentityData.SecurePassword = new SecurePassword();
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('P');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('A');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('S');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('S');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('W');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('O');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('R');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('D');
cobraServices.ServiceIdentityData.DataSourceKey = "COBRA";
LoginResult loginResult = cobraServices.Login();
if (!loginResult.Success) {
Console.WriteLine("Login failed.");
return;
}
Console.WriteLine("Login Success.");
ProjectOperations projectOperations = cobraServices.CreateServiceOperations<ProjectOperations>();
CopyProjectServiceArguments copyProjectServiceArguments = projectOperations.CreateProjectOperationsServiceArguments<CopyProjectServiceArguments>();
copyProjectServiceArguments.CopyFrom = "Demo";
copyProjectServiceArguments.CopyTo = "Demo Advanced";
copyProjectServiceArguments.NewDescription = "This is demo project.";
Console.WriteLine("Running Copy Project...");
ServiceResult copyProjectResult = projectOperations.CopyProject(copyProjectServiceArguments);
if (copyProjectResult.Success)
Console.WriteLine("Copy Project process completed successfully.");
else
Console.WriteLine("Copy Project process did not completed successfully.");
cobraServices.LogOut();
See Also