Share via


CReplicationProject.Cancel Method

Cancels the replication that is currently running for a Commerce Server Staging (CSS) project.

void Cancel()

Remarks

The CReplicationProject.Cancel method corresponds to the COM method named ReplicationProject.Cancel.

Example

The following example cancels the CSS project named Project1 if the replication has been aborted.

CReplicationServer replicationServer = new CReplicationServer();
replicationServer.Initialize("");
CReplicationProject replicationProject;
replicationProject = (CReplicationProject)replicationServer.OpenProject("Project1", CSS_PROJECT_CREATION.OPEN_EXISTING_PROJECT);
  CReplicationInstance replicationInstance;
  replicationInstance = (CReplicationInstance)replicationProject.Start(0);
  int replicationState;
  replicationState = (int)replicationInstance.State;
  // Exit if the state is aborted
  if (replicationState == 4)
      replicationProject.Cancel();

See Also

Other Resources

Projects

How to Create and Modify a Staging Project

How to Start and Stop Project Replication

How to Retrieve Project Information

CReplicationClient.Abort Method

CReplicationProject.Start Method

CReplicationInstance.State Property

CReplicationProject Class