/// <summary>
        /// Validates null values and other possible combinations
        /// </summary>
        public override void Validate()
        {
            base.Validate();

            if (IsDailyScheduleEnabled == false && IsWeeklyScheduleEnabled == false &&
                IsMonthlyScheduleEnabled == false && IsYearlyScheduleEnabled == false)
            {
                throw new ArgumentException(Resources.AllRetentionSchedulesEmptyException);
            }

            if (IsDailyScheduleEnabled)
            {
                if (DailySchedule == null)
                {
                    throw new ArgumentException(Resources.DailyScheduleEnabledButScheduleIsNullException);
                }
                else
                {
                    DailySchedule.Validate();
                }
            }

            if (IsWeeklyScheduleEnabled)
            {
                if (WeeklySchedule == null)
                {
                    throw new ArgumentException(Resources.WeeklyScheduleEnabledButScheduleIsNullException);
                }
                else
                {
                    WeeklySchedule.Validate();
                }
            }

            if (IsMonthlyScheduleEnabled)
            {
                if (MonthlySchedule == null)
                {
                    throw new ArgumentException(Resources.MonthlyScheduleEnabledButScheduleIsNullException);
                }
                else
                {
                    MonthlySchedule.Validate();
                }
            }

            if (IsYearlyScheduleEnabled)
            {
                if (YearlySchedule == null)
                {
                    throw new ArgumentException(Resources.YearlyScheduleEnabledButScheduleIsNullException);
                }
                else
                {
                    YearlySchedule.Validate();
                }
            }
        }
 public override string ToString()
 {
     return(string.Format("IsDailyScheduleEnabled:{0}, IsWeeklyScheduleEnabled:{1}, " +
                          "IsMonthlyScheduleEnabled:{2}, IsYearlyScheduleEnabled:{3}" +
                          "DailySchedule: {4}, WeeklySchedule: {5}, MonthlySchedule:{6}, YearlySchedule:{7}",
                          IsDailyScheduleEnabled, IsWeeklyScheduleEnabled,
                          IsMonthlyScheduleEnabled, IsYearlyScheduleEnabled,
                          DailySchedule == null ? "NULL" : DailySchedule.ToString(),
                          WeeklySchedule == null ? "NULL" : WeeklySchedule.ToString(),
                          MonthlySchedule == null ? "NULL" : MonthlySchedule.ToString(),
                          YearlySchedule == null ? "NULL" : YearlySchedule.ToString()));
 }
        /// <summary>
        /// Validates null values and other possible combinations
        /// </summary>
        public void Validate(ScheduleRunType ScheduleRunFrequency = 0)
        {
            base.Validate();

            if (IsDailyScheduleEnabled == false && IsWeeklyScheduleEnabled == false &&
                IsMonthlyScheduleEnabled == false && IsYearlyScheduleEnabled == false)
            {
                throw new ArgumentException(Resources.AllRetentionSchedulesEmptyException);
            }

            if (IsDailyScheduleEnabled)
            {
                if (DailySchedule == null)
                {
                    throw new ArgumentException(Resources.DailyScheduleEnabledButScheduleIsNullException);
                }
                else
                {
                    DailySchedule.BackupManagementType = BackupManagementType;
                    DailySchedule.Validate(ScheduleRunFrequency);
                }
            }

            if (IsWeeklyScheduleEnabled)
            {
                if (WeeklySchedule == null)
                {
                    throw new ArgumentException(Resources.WeeklyScheduleEnabledButScheduleIsNullException);
                }
                else
                {
                    WeeklySchedule.BackupManagementType = BackupManagementType;
                    WeeklySchedule.Validate(ScheduleRunFrequency);
                }
            }

            if (IsMonthlyScheduleEnabled)
            {
                if (MonthlySchedule == null)
                {
                    throw new ArgumentException(Resources.MonthlyScheduleEnabledButScheduleIsNullException);
                }
                else
                {
                    MonthlySchedule.BackupManagementType = BackupManagementType;
                    MonthlySchedule.Validate(ScheduleRunFrequency);
                }
            }

            if (IsYearlyScheduleEnabled)
            {
                if (YearlySchedule == null)
                {
                    throw new ArgumentException(Resources.YearlyScheduleEnabledButScheduleIsNullException);
                }
                else
                {
                    YearlySchedule.BackupManagementType = BackupManagementType;
                    YearlySchedule.Validate(ScheduleRunFrequency);
                }
            }
        }