private MultiValuedProperty <string> CollectCapabilities(XmlValueAssignedPlan[] assignedPlans) { MultiValuedProperty <string> multiValuedProperty = new MultiValuedProperty <string>(); foreach (XmlValueAssignedPlan xmlValueAssignedPlan in assignedPlans) { multiValuedProperty.TryAdd(this.GetXmlElementString(xmlValueAssignedPlan.Plan.Capability)); } return(multiValuedProperty); }
private MultiValuedProperty <string> CollectErrorDetails(XmlValueValidationError[] validationErrors) { MultiValuedProperty <string> multiValuedProperty = new MultiValuedProperty <string>(); foreach (XmlValueValidationError xmlValueValidationError in validationErrors) { multiValuedProperty.TryAdd(this.GetXmlElementString(xmlValueValidationError.ErrorInfo.ErrorDetail)); } return(multiValuedProperty); }
internal static MultiValuedProperty <T> ToMultiValuedProperty <T>(IEnumerable <T> collection) { if (collection is MultiValuedProperty <T> ) { return((MultiValuedProperty <T>)collection); } MultiValuedProperty <T> multiValuedProperty = new MultiValuedProperty <T>(); foreach (T item in collection) { multiValuedProperty.TryAdd(item); } return(multiValuedProperty); }
public void SetIntraOrganizationConnector(string identity, string discoveryEndpoint, string onlineTargetAddress, bool enabled) { SessionParameters sessionParameters = new SessionParameters(); sessionParameters.Set("Identity", identity); sessionParameters.Set("DiscoveryEndpoint", discoveryEndpoint); MultiValuedProperty <SmtpDomain> multiValuedProperty = new MultiValuedProperty <SmtpDomain>(); SmtpDomain item = new SmtpDomain(onlineTargetAddress); multiValuedProperty.TryAdd(item); sessionParameters.Set <SmtpDomain>("TargetAddressDomains", multiValuedProperty); sessionParameters.Set("Enabled", enabled); base.RemotePowershellSession.RunOneCommand("Set-IntraOrganizationConnector", sessionParameters, false); }
internal static MultiValuedProperty <BindingMetadata> GetScopesFromStorage(BindingStorage bindingStorage) { ArgumentValidator.ThrowIfNull("bindingStorage", bindingStorage); MultiValuedProperty <BindingMetadata> multiValuedProperty = new MultiValuedProperty <BindingMetadata>(); if (bindingStorage.AppliedScopes.Any <ScopeStorage>()) { foreach (ScopeStorage scopeStorage in bindingStorage.AppliedScopes) { if (scopeStorage.Mode == Mode.Enforce) { multiValuedProperty.TryAdd(BindingMetadata.FromStorage(scopeStorage.Scope)); } } } multiValuedProperty.ResetChangeTracking(); return(multiValuedProperty); }