ProjectOperationsRespread Method (RespreadServiceArguments) |
Run the Respread
Namespace:
Cobra.WebService.ClientAPI.Application.Files
Assembly:
Cobra.WebService.ClientAPI (in Cobra.WebService.ClientAPI.dll) Version: 8.3.715.2595 (8.3.0715.2595)
Syntax Exceptions Exception | Condition |
---|
InvalidOperationException | Thrown when state of the instance of the CobraServices that generated the current ProjectOperations is not in opened state. |
Examples
This sample shows how to run the Respread.
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');
LoginResult loginResult = cobraServices.Login();
if (!loginResult.Success) {
Console.WriteLine("Login failed.");
return;
}
Console.WriteLine("Login Success.");
ProjectOperations projectOperations = cobraServices.CreateServiceOperations<ProjectOperations>();
Cobra.Model.WebService.RespreadServiceArguments respreadServiceArguments = projectOperations.CreateProjectOperationsServiceArguments<Cobra.Model.WebService.RespreadServiceArguments>();
respreadServiceArguments.Project = "Demo";
respreadServiceArguments.ClassList = new StringCollection();
respreadServiceArguments.ClassList.Add("Budget");
respreadServiceArguments.ClassList.Add("OTB");
respreadServiceArguments.ClassList.Add("Replanned");
Console.WriteLine("Running Respread...");
ServiceResult respreadResult = projectOperations.Respread(respreadServiceArguments);
if (respreadResult.Success)
Console.WriteLine("Calculate Respread process completed successfully.");
else
Console.WriteLine("Calculate Respread process did not completed successfully.");
cobraServices.LogOut();
See Also