CReplicationProject.EnumSchedules Method

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

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

object EnumSchedules(ref object iterator)

Parameters

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

Return Value

A CReplicationSchedule object 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.EnumSchedules method corresponds to the COM method named ReplicationProject.EnumSchedules.

Example

The following example displays the descriptions for the schedules for the project named Project1.

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

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

  CReplicationSchedule replicationSchedule;
  int iterator = 0;
  object i = iterator as object;

  Console.WriteLine("The schedule descriptions for Project1 are");

  while (true)
  {
      try
      {
          replicationSchedule = (CReplicationSchedule)replicationProject.EnumSchedules(ref i);
          Console.WriteLine(replicationSchedule.Description);
      }
      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

Schedules

How to Create and Modify a Staging Project

How to Manage Staging Schedules

How to Retrieve Project Information

CReplicationProject.AddSchedule Method

CReplicationSchedule Class

CReplicationProject Class