예제 #1
0
        public void ValidateLongTermRetentionPolicy(CmdletModel.RetentionPolicyBase policy, string backupManagementType = "", ScheduleRunType ScheduleRunFrequency = 0)
        {
            if (policy == null || policy.GetType() != typeof(CmdletModel.LongTermRetentionPolicy))
            {
                throw new ArgumentException(
                          string.Format(
                              Resources.InvalidRetentionPolicyException,
                              typeof(CmdletModel.LongTermRetentionPolicy).ToString()));
            }

            ((CmdletModel.LongTermRetentionPolicy)policy).Validate(ScheduleRunFrequency);
        }
        public void ValidateLongTermRetentionPolicy(CmdletModel.RetentionPolicyBase policy)
        {
            if (policy == null || policy.GetType() != typeof(CmdletModel.LongTermRetentionPolicy))
            {
                throw new ArgumentException(
                          string.Format(
                              Resources.InvalidRetentionPolicyException,
                              typeof(CmdletModel.LongTermRetentionPolicy).ToString()));
            }

            // perform validation
            policy.Validate();
        }