CReplicationRoute.EnumDestination Method

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

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

object EnumDestination(ref object iterator)

Parameters

  • iterator
    Used by the 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 name of the destination for the current iteration, or the numeric value -2147422485 (“No more items.”), which indicates the end of the enumeration.

Remarks

The CReplicationRoute.EnumDestination method corresponds to the COM method named ReplicationRoute.EnumDestination.

Example

The following example lists the destinations for the CSS route named Temp.

CReplicationServer replicationServer = new CReplicationServer();
replicationServer.Initialize("");
CReplicationRoute replicationRoute;
int i = 0;
object iterator1 = i as object;
// Get route "Temp" and list its destinations
while (true)
  {
  try
    {
    replicationRoute = replicationServer.EnumRoutes(ref iterator1) as CReplicationRoute;
    if (replicationRoute.get_Name().ToString() == "Temp")
      {
      Console.WriteLine("The Temp route has the following destinations:");
      int j = 0;
      object iterator2 = j as object;
      while (true)
        {
        try
          {
          Console.WriteLine(replicationRoute.EnumDestination(ref iterator2).ToString());
          }
        catch (System.Runtime.InteropServices.COMException e)
          {
            if (e.ErrorCode == -2147422485)
               break;
            else
               throw e;
           }
        }
        break;
      }
    }
    catch (System.Runtime.InteropServices.COMException e)
    {
      // Quit if "No more items" or "No routes" error
      if (e.ErrorCode == -2147422485 || e.ErrorCode == -1073680678)
        break;
      else
        throw;
    }
  }

See Also

Other Resources

CReplicationRoute.Enum Method

CReplicationRoute Class