Delen via


CReplicationSchedule.IsRunOnce Property

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

Gets a value that indicates whether a nonrecurring schedule has been defined for a Commerce Server Staging (CSS) project.

object IsRunOnce { get; }

Return Value

A Boolean value that indicates whether the RunOnce property contains a valid value.

Remarks

A schedule is determined to run one time only when the RunOnce property contains a valid value.

The CReplicationSchedule.IsRunOnce property corresponds to the COM property named ReplicationSchedule.IsRunOnce.

Example

The following example displays the descriptions of replication schedules that were set up to run one time for 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 following schedules are set up to run once");
while (true)
  {
    try
    {
        replicationSchedule = (CReplicationSchedule)replicationProject.EnumSchedules(ref i);
        if ((bool)replicationSchedule.IsRunOnce)
            Console.WriteLine(replicationSchedule.Description);
    }
    catch (System.Runtime.InteropServices.COMException e)
    {
        // Quit if "No more items" error
        if (e.ErrorCode == -2147422485)
            break;
        else
            throw e;
    }
  }

See Also

Other Resources

CReplicationSchedule.RunOnce Property

CReplicationProject.AddSchedule Method

CReplicationProject.EnumSchedules Method

CReplicationSchedule Class