Ejemplo n.º 1
0
        internal static object SKUCapabilityGetter(IPropertyBag propertyBag)
        {
            Capability        capability = Capability.None;
            AssignedPlanValue effectiveRootServicePlan = SyncUser.GetEffectiveRootServicePlan(propertyBag);

            if (effectiveRootServicePlan != null)
            {
                capability = SyncUser.GetExchangeCapability(effectiveRootServicePlan.Capability);
            }
            return(capability);
        }
Ejemplo n.º 2
0
        private static MultiValuedProperty <Capability> GetEffectivePersistedCapabilities(IPropertyBag propertyBag)
        {
            MultiValuedProperty <AssignedPlanValue> multiValuedProperty  = (MultiValuedProperty <AssignedPlanValue>)propertyBag[SyncCompanySchema.AssignedPlan];
            MultiValuedProperty <Capability>        multiValuedProperty2 = new MultiValuedProperty <Capability>();

            if (multiValuedProperty != null && multiValuedProperty.Count != 0)
            {
                foreach (AssignedPlanValue assignedPlanValue in multiValuedProperty)
                {
                    Capability exchangeCapability = SyncUser.GetExchangeCapability(assignedPlanValue.Capability);
                    if (assignedPlanValue.CapabilityStatus != AssignedCapabilityStatus.Deleted && exchangeCapability != Capability.None && !multiValuedProperty2.Contains(exchangeCapability))
                    {
                        multiValuedProperty2.Add(exchangeCapability);
                    }
                }
            }
            return(multiValuedProperty2);
        }
Ejemplo n.º 3
0
        private static MultiValuedProperty <Capability> GetEffectiveAddOnSKUCapabilities(IPropertyBag propertyBag)
        {
            MultiValuedProperty <AssignedPlanValue> multiValuedProperty  = (MultiValuedProperty <AssignedPlanValue>)propertyBag[SyncUserSchema.AssignedPlan];
            MultiValuedProperty <Capability>        multiValuedProperty2 = new MultiValuedProperty <Capability>();

            if (multiValuedProperty != null && multiValuedProperty.Count != 0)
            {
                foreach (AssignedPlanValue assignedPlanValue in multiValuedProperty)
                {
                    Capability exchangeCapability = SyncUser.GetExchangeCapability(assignedPlanValue.Capability);
                    if (CapabilityHelper.IsAddOnSKUCapability(exchangeCapability) && assignedPlanValue.CapabilityStatus != AssignedCapabilityStatus.Deleted)
                    {
                        multiValuedProperty2.Add(exchangeCapability);
                    }
                }
            }
            return(multiValuedProperty2);
        }
Ejemplo n.º 4
0
        private static AssignedPlanValue GetEffectiveRootServicePlan(IPropertyBag propertyBag)
        {
            AssignedPlanValue assignedPlanValue = null;
            MultiValuedProperty <AssignedPlanValue> multiValuedProperty = (MultiValuedProperty <AssignedPlanValue>)propertyBag[SyncUserSchema.AssignedPlan];

            if (multiValuedProperty != null && multiValuedProperty.Count != 0)
            {
                IOrderedEnumerable <AssignedPlanValue> source = from ap in multiValuedProperty
                                                                orderby ap.AssignedTimestamp descending
                                                                select ap;
                foreach (AssignedPlanValue assignedPlanValue2 in from ap in source
                         where ap.CapabilityStatus != AssignedCapabilityStatus.Deleted
                         select ap)
                {
                    if (CapabilityHelper.IsRootSKUCapability(SyncUser.GetExchangeCapability(assignedPlanValue2.Capability)))
                    {
                        assignedPlanValue = assignedPlanValue2;
                        break;
                    }
                }
                if (assignedPlanValue == null)
                {
                    foreach (AssignedPlanValue assignedPlanValue3 in from ap in source
                             where ap.CapabilityStatus == AssignedCapabilityStatus.Deleted
                             select ap)
                    {
                        if (CapabilityHelper.IsRootSKUCapability(SyncUser.GetExchangeCapability(assignedPlanValue3.Capability)))
                        {
                            assignedPlanValue = assignedPlanValue3;
                            break;
                        }
                    }
                }
            }
            return(assignedPlanValue);
        }