Changeset 905 for branches/eraser6/Manager/Schedule.cs
- Timestamp:
- 4/28/2009 12:13:51 PM (4 years ago)
- File:
-
- 1 edited
-
branches/eraser6/Manager/Schedule.cs (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Manager/Schedule.cs
r826 r905 128 128 switch (type) 129 129 { 130 case ScheduleUnit.D AILY:130 case ScheduleUnit.Daily: 131 131 if (frequency != 1) 132 132 result = S._("Once every {0} days", frequency); … … 134 134 result = S._("Once every day"); 135 135 break; 136 case ScheduleUnit.W EEKDAYS:136 case ScheduleUnit.Weekdays: 137 137 result = S._("Every weekday"); 138 138 break; 139 case ScheduleUnit.W EEKLY:140 if ((weeklySchedule & DaysOfWeek.M ONDAY) != 0)139 case ScheduleUnit.Weekly: 140 if ((weeklySchedule & DaysOfWeek.Monday) != 0) 141 141 result = S._("Every Monday, {0}"); 142 if ((weeklySchedule & DaysOfWeek.T UESDAY) != 0)142 if ((weeklySchedule & DaysOfWeek.Tuesday) != 0) 143 143 result += S._("Every Tuesday, {0}"); 144 if ((weeklySchedule & DaysOfWeek.W EDNESDAY) != 0)144 if ((weeklySchedule & DaysOfWeek.Wednesday) != 0) 145 145 result += S._("Every Wednesday, {0}"); 146 if ((weeklySchedule & DaysOfWeek.T HURSDAY) != 0)146 if ((weeklySchedule & DaysOfWeek.Thursday) != 0) 147 147 result += S._("Every Thursday, {0}"); 148 if ((weeklySchedule & DaysOfWeek.F RIDAY) != 0)148 if ((weeklySchedule & DaysOfWeek.Friday) != 0) 149 149 result += S._("Every Friday, {0}"); 150 if ((weeklySchedule & DaysOfWeek.S ATURDAY) != 0)150 if ((weeklySchedule & DaysOfWeek.Saturday) != 0) 151 151 result += S._("Every Saturday, {0}"); 152 if ((weeklySchedule & DaysOfWeek.S UNDAY) != 0)152 if ((weeklySchedule & DaysOfWeek.Sunday) != 0) 153 153 result += S._("Every Sunday, {0}"); 154 154 … … 157 157 S._("once every {0} weeks.", frequency)); 158 158 break; 159 case ScheduleUnit.M ONTHLY:159 case ScheduleUnit.Monthly: 160 160 if (frequency == 1) 161 161 result = S._("On day {0} of every month", monthlySchedule); … … 212 212 /// Daily schedule type 213 213 /// </summary> 214 D AILY,214 Daily, 215 215 216 216 /// <summary> 217 217 /// Weekdays-only schedule type 218 218 /// </summary> 219 W EEKDAYS,219 Weekdays, 220 220 221 221 /// <summary> 222 222 /// Weekly schedule type 223 223 /// </summary> 224 W EEKLY,224 Weekly, 225 225 226 226 /// <summary> 227 227 /// Monthly schedule type 228 228 /// </summary> 229 M ONTHLY229 Monthly 230 230 } 231 231 … … 233 233 /// The days of the week, with values usable in a bitfield. 234 234 /// </summary> 235 [Flags] 235 236 public enum DaysOfWeek 236 237 { 237 SUNDAY = 1 << DayOfWeek.Sunday, 238 MONDAY = 1 << DayOfWeek.Monday, 239 TUESDAY = 1 << DayOfWeek.Tuesday, 240 WEDNESDAY = 1 << DayOfWeek.Wednesday, 241 THURSDAY = 1 << DayOfWeek.Thursday, 242 FRIDAY = 1 << DayOfWeek.Friday, 243 SATURDAY = 1 << DayOfWeek.Saturday 238 None = 0, 239 Sunday = 1 << DayOfWeek.Sunday, 240 Monday = 1 << DayOfWeek.Monday, 241 Tuesday = 1 << DayOfWeek.Tuesday, 242 Wednesday = 1 << DayOfWeek.Wednesday, 243 Thursday = 1 << DayOfWeek.Thursday, 244 Friday = 1 << DayOfWeek.Friday, 245 Saturday = 1 << DayOfWeek.Saturday 244 246 } 245 247 … … 247 249 /// The type of schedule. 248 250 /// </summary> 249 public ScheduleUnit Type251 public ScheduleUnit ScheduleType 250 252 { 251 253 get { return type; } … … 261 263 get 262 264 { 263 if ( Type != ScheduleUnit.DAILY && Type != ScheduleUnit.WEEKLY&&264 Type != ScheduleUnit.MONTHLY)265 if (ScheduleType != ScheduleUnit.Daily && ScheduleType != ScheduleUnit.Weekly && 266 ScheduleType != ScheduleUnit.Monthly) 265 267 throw new ArgumentException(S._("The ScheduleUnit of the schedule does " + 266 268 "not require a frequency value, this field would contain garbage.")); … … 296 298 get 297 299 { 298 if ( Type != ScheduleUnit.WEEKLY)300 if (ScheduleType != ScheduleUnit.Weekly) 299 301 throw new ArgumentException(S._("The ScheduleUnit of the schedule does " + 300 302 "not require the WeeklySchedule value, this field would contain garbage")); … … 320 322 get 321 323 { 322 if ( Type != ScheduleUnit.MONTHLY)324 if (ScheduleType != ScheduleUnit.Monthly) 323 325 throw new ArgumentException(S._("The ScheduleUnit of the schedule does " + 324 326 "not require the MonthlySchedule value, this field would contain garbage")); … … 356 358 nextRun = nextRun.AddSeconds(executionTime.Second - nextRun.Second); 357 359 358 switch ( Type)360 switch (ScheduleType) 359 361 { 360 case ScheduleUnit.D AILY:362 case ScheduleUnit.Daily: 361 363 { 362 364 //First assume that it is today that we are running the schedule … … 370 372 break; 371 373 } 372 case ScheduleUnit.W EEKDAYS:374 case ScheduleUnit.Weekdays: 373 375 { 374 376 while (nextRun < DateTime.Now || … … 378 380 break; 379 381 } 380 case ScheduleUnit.W EEKLY:382 case ScheduleUnit.Weekly: 381 383 { 382 384 if (weeklySchedule == 0) … … 405 407 break; 406 408 } 407 case ScheduleUnit.M ONTHLY:409 case ScheduleUnit.Monthly: 408 410 //Step the number of months since the last run 409 411 if (LastRun != DateTime.MinValue) … … 444 446 private bool CanRunOnDay(DateTime date) 445 447 { 446 if ( Type != ScheduleUnit.WEEKLY)448 if (ScheduleType != ScheduleUnit.Weekly) 447 449 throw new ArgumentException(S._("The ScheduleUnit of the schedule does " + 448 450 "not use the WeeklyScheduly value, this field would contain garbage"));
Note: See TracChangeset
for help on using the changeset viewer.
