예제 #1
0
 private static void ValidateForWeeklyBackupSchedule(RetentionFormat RetentionScheduleType, string backupScheduleType, IList <DayOfWeek> backupScheduleRunDays, List <DayOfWeek> retentionScheduleRunDays)
 {
     if (string.Compare(backupScheduleType, ScheduleType.Weekly.ToString(), true) == 0)
     {
         if (RetentionScheduleType == RetentionFormat.Daily)
         {
             throw new ArgumentException(Resources.DaysOfMonthsNotAllowedinMonthlyYearlyFormat);
         }
         foreach (var day in retentionScheduleRunDays)
         {
             if (!backupScheduleRunDays.Contains(day))
             {
                 throw new ArgumentException(Resources.MonthlyYearlyRetentionArgumentException);
             }
         }
     }
 }
        private static void ValidateForWeeklyBackupSchedule(RetentionFormat RetentionScheduleType, string backupScheduleType, IList<DayOfWeek> backupScheduleRunDays, List<DayOfWeek> retentionScheduleRunDays)
        {
            if (string.Compare(backupScheduleType, ScheduleType.Weekly.ToString(), true) == 0)
            {
                if (RetentionScheduleType == RetentionFormat.Daily)
                {
                    throw new ArgumentException(Resources.DaysOfMonthsNotAllowedinMonthlyYearlyFormat);
                }
                foreach (var day in retentionScheduleRunDays)
                {
                    if (!backupScheduleRunDays.Contains(day))
                    {
                        throw new ArgumentException(Resources.MonthlyYearlyRetentionArgumentException);
                    }
                }
            }

        }
 public AzureBackupYearlyRetentionPolicy(string retentionType, int retention, List<Month> monthsOfYear, RetentionFormat retentionFormat, List<string> daysOfMonth,
     List<WeekNumber> weekNumber, List<DayOfWeek> daysOfWeek)
     : base(retentionType, retention)
 {
     this.MonthsOfYear = monthsOfYear;
     this.RetentionFormat = retentionFormat;
     this.DaysOfMonth = daysOfMonth;
     this.WeekNumber = weekNumber;
     this.DaysOfWeek = daysOfWeek;
 }
예제 #4
0
 public AzureBackupYearlyRetentionPolicy(string retentionType, int retention, List <Month> monthsOfYear, RetentionFormat retentionFormat, List <string> daysOfMonth,
                                         List <WeekNumber> weekNumber, List <DayOfWeek> daysOfWeek)
     : base(retentionType, retention)
 {
     this.MonthsOfYear    = monthsOfYear;
     this.RetentionFormat = retentionFormat;
     this.DaysOfMonth     = daysOfMonth;
     this.WeekNumber      = weekNumber;
     this.DaysOfWeek      = daysOfWeek;
 }