private MultiValuedProperty <BindingMetadata> ValidateSharepointSitesForRemove(IEnumerable <string> sitesToRemove) { base.WriteVerbose(Strings.VerboseValidatingRemoveSharepointBinding); SharepointValidator sharepointValidator = this.CreateSharepointValidator("Validating RemoveSharepointBinding", 0); return(sharepointValidator.ValidateLocations(sitesToRemove)); }
private MultiValuedProperty <BindingMetadata> ValidateSharepointSitesForAdd(MultiValuedProperty <BindingMetadata> psObjectBindings, MultiValuedProperty <BindingMetadata> internalRemoveBindings, MultiValuedProperty <string> addBindingParameter, Workload subWorkload) { base.WriteVerbose(Strings.VerboseValidatingAddSharepointBinding); int existingSitesCount = SetCompliancePolicyBase.CalculateBindingCountAfterRemove(psObjectBindings, internalRemoveBindings); SharepointValidator sharepointValidator = this.CreateSharepointValidator("Validating AddSharepointBinding", existingSitesCount); MultiValuedProperty <BindingMetadata> multiValuedProperty = sharepointValidator.ValidateLocations(addBindingParameter); NewCompliancePolicyBase.SetBindingsSubWorkload(multiValuedProperty, subWorkload); return(multiValuedProperty); }
private MultiValuedProperty <BindingMetadata> ValidateSharepointBindings(IEnumerable <string> bindings, Workload subWorkload, string workloadName, int maxCount) { base.WriteVerbose(Strings.VerboseValidatingSharepointBinding(workloadName)); MultiValuedProperty <BindingMetadata> multiValuedProperty = new MultiValuedProperty <BindingMetadata>(); if (bindings.Any <string>()) { bindings = NewCompliancePolicyBase.ValidateWideScopeBinding(bindings, "All", "All", new BindingCannotCombineAllWithIndividualBindingsException(workloadName)); SharepointValidator sharepointValidator = this.CreateSharepointValidator(string.Format("Validating {0} Binding", workloadName)); multiValuedProperty = sharepointValidator.ValidateLocations(bindings); if (multiValuedProperty.Count <BindingMetadata>() > maxCount) { throw new BindingCountExceedsLimitException(workloadName, maxCount); } NewCompliancePolicyBase.SetBindingsSubWorkload(multiValuedProperty, subWorkload); } return(multiValuedProperty); }