internal static TimeBasedBackupSchedule FromTimeBasedBackupScheduleView(
            BackupRestoreView.TimeBasedBackupSchedule timeBasedBackupScheduleView)
        {
            var timeBasedBackupSchedule = new TimeBasedBackupSchedule
            {
                runDays = timeBasedBackupScheduleView.RunDays == null ? new List <DayOfWeek>() :  timeBasedBackupScheduleView.RunDays?.Distinct().ToList(),
                ScheduleFrequencyType = timeBasedBackupScheduleView.ScheduleFrequencyType,
                runTimes = timeBasedBackupScheduleView.RunTimes?.Distinct().ToList()
            };

            return(timeBasedBackupSchedule);
        }
Beispiel #2
0
        protected internal static BackupSchedule FromBackupScheduleView(BackupRestoreView.BackupSchedule backupScheduleView)
        {
            BackupSchedule backupSchedule = null;

            if (backupScheduleView.ScheduleKind == Enums.BackupScheduleType.FrequencyBased)
            {
                backupSchedule =
                    FrequencyBasedBackupSchedule.FromFrequencyBasedBackupScheduleView(
                        (BackupRestoreView.FrequencyBasedBackupSchedule)backupScheduleView);
            }
            else if (backupScheduleView.ScheduleKind == BackupScheduleType.TimeBased)
            {
                backupSchedule =
                    TimeBasedBackupSchedule.FromTimeBasedBackupScheduleView(
                        (BackupRestoreView.TimeBasedBackupSchedule)backupScheduleView);
            }
            return(backupSchedule);
        }
 internal TimeBasedBackupSchedule(TimeBasedBackupSchedule other) : this()
 {
     this.runDays  = new List <DayOfWeek>(other.runDays);
     this.runTimes = new List <TimeSpan>(other.runTimes);
     this.ScheduleFrequencyType = other.ScheduleFrequencyType;
 }