Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }