Esempio n. 1
0
        internal static BackupPolicy FromBackupPolicyView(BackupRestoreView.BackupPolicy backupPolicyView)
        {
            backupPolicyView.ThrowIfNull("BackupPolicy");
            BackupPolicy backupPolicy = new BackupPolicy
            {
                Name                 = backupPolicyView.Name,
                AutoRestore          = backupPolicyView.AutoRestoreOnDataLoss,
                MaxIncrementalBackup = backupPolicyView.MaxIncrementalBackups,
                BackupSchedule       = BackupSchedule.FromBackupScheduleView(backupPolicyView.Schedule),
                Storage              = BackupStorage.FromBackupStorageView(backupPolicyView.Storage),
                RetentionPolicy      = RetentionPolicy.FromRetentionPolicyView(backupPolicyView.RetentionPolicy)
            };

            return(backupPolicy);
        }
Esempio n. 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);
        }