CReplicationSchedule.Remove Method

Delete a schedule from a Commerce Server Staging (CSS) project.

void Remove()

Remarks

You must have CSS administrator rights to call this method.

The CReplicationSchedule.Remove method corresponds to the COM method named ReplicationSchedule.Remove.

Example

The following example removes all the schedules that are defined for the Test project.

CReplicationServer replicationServer = new CReplicationServer();
replicationServer.Initialize("");
CReplicationProject replicationProject = (CReplicationProject)replicationServer.OpenProject("Test", CSS_PROJECT_CREATION.OPEN_EXISTING_PROJECT);
CReplicationSchedule replicationSchedule;
int iterator = 0;
object i = iterator as object;
while (true)
{
    try
    {
        replicationSchedule = (CReplicationSchedule)replicationProject.EnumSchedules(ref i);
        replicationSchedule.Remove();
    }
    catch (System.Runtime.InteropServices.COMException e)
    {
        // Quit if "No more items" error
        if (e.ErrorCode == -2147422485)
             break;
        else
             throw e;
    }
}

See Also

Other Resources

CReplicationProject.AddSchedule Method

CReplicationProject.EnumSchedules Method

CReplicationSchedule Class