Share via


CReplicationProject.EnumDestination Method

Retrieves the destinations that are defined for a Commerce Server Staging (CSS) project.

object EnumDestination(ref object iterator)

Parameters

  • iterator
    Used by the CSS service to enumerate the list of destinations. This value should be initialized to 0 (zero) and should not be modified.

Return Value

A string that contains the destination name for this iteration.

Remarks

This method sets the value of e.ErrorCode to -2147422485 (“No more items.”) to indicate the end of the enumeration.

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

Example

The following example displays the destinations that are defined for the project named Project1.

CReplicationServer replicationServer = new CReplicationServer();
  replicationServer.Initialize("");

  CReplicationProject replicationProject;
  replicationProject = (CReplicationProject)replicationServer.OpenProject("Project1", CSS_PROJECT_CREATION.OPEN_EXISTING_PROJECT);

  Console.WriteLine("The destination servers for Project1 are:");
  int iterator = 0;
  object i = iterator as object;
  while (true)
  {
      try
      {
          string destination = (string)replicationProject.EnumDestination(ref i);
          Console.WriteLine(destination);
      }
      catch (System.Runtime.InteropServices.COMException e)
      {
       // Exit if "No more items" error
       if (e.ErrorCode == -2147422485)
        break;
    else
        throw e;
      }
  }

See Also

Other Resources

Projects

Routes

How to Create and Modify a Staging Project

How to Manage Routes

How to Retrieve Project Information

CReplicationProject.Enum Method

CReplicationProject Class