CReplicationSchedule.Days Property

Gets or sets the days of the week for a recurring schedule that is defined for a Commerce Server Staging (CSS) project.

object Days { set; get; })

Return Value

A bit field in which the bits indicate days of the week. The following table lists the constant values (and therefore the bits) that represent each day of the week, and includes a value that indicates daily replication.

Day of week constant

Value (bit position)

CSS_SCHEDULE_DAY_MONDAY

1

CSS_SCHEDULE_DAY_TUESDAY

2

CSS_SCHEDULE_DAY_WEDNESDAY

4

CSS_SCHEDULE_DAY_THURSDAY

8

CSS_SCHEDULE_DAY_FRIDAY

16

CSS_SCHEDULE_DAY_SATURDAY

32

CSS_SCHEDULE_DAY_SUNDAY

64

CSS_SCHEDULE_DAILY

255

Remarks

You must have CSS administrator rights to set this property.

You can use a bitwise OR operation with these values to specify any combination of days. Use the constant value CSS_SCHEDULE_DAILY to set the bits for all the days of the week.

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

Example

The following example creates a new recurring schedule to replicate the project named Test on Mondays and Fridays at 3:00 PM.

const int Monday = 0x1;
const int Tuesday = 0x2;
const int Wednesday = 0x4;
const int Thursday = 0x8;
const int Friday = 0x10;
const int Saturday = 0x20;
const int Sunday = 0x40;
const int Daily = 0xFF;
CReplicationServer replicationServer = new CReplicationServer();
replicationServer.Initialize("");
CReplicationProject replicationProject = (CReplicationProject)replicationServer.OpenProject("Test", CSS_PROJECT_CREATION.OPEN_EXISTING_PROJECT);
CReplicationSchedule repSched = (CReplicationSchedule)replicationProject.AddSchedule();
repSched.set_Days(Monday | Friday);
repSched.set_Hour(15);
repSched.set_ScheduledAction(CSS_SCHEDULE_ACTION.CSS_SCHEDULE_REPLICATE);
repSched.Commit();

See Also

Other Resources

CReplicationSchedule.Hour Property

CReplicationSchedule.Minute Property

CReplicationProject.AddSchedule Method

CReplicationProject.EnumSchedules Method

CReplicationSchedule Class