Пример #1
0
        internal static object SKUCapabilityStatusGetter(IPropertyBag propertyBag)
        {
            AssignedCapabilityStatus?assignedCapabilityStatus = null;
            AssignedPlanValue        effectiveRootServicePlan = SyncUser.GetEffectiveRootServicePlan(propertyBag);

            if (effectiveRootServicePlan != null)
            {
                assignedCapabilityStatus = new AssignedCapabilityStatus?(effectiveRootServicePlan.CapabilityStatus);
            }
            return(assignedCapabilityStatus);
        }
Пример #2
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);
        }
Пример #3
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);
        }
Пример #4
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);
        }
Пример #5
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);
        }
Пример #6
0
        internal static object SKUAssignedGetter(IPropertyBag propertyBag)
        {
            AssignedCapabilityStatus?assignedCapabilityStatus = (AssignedCapabilityStatus?)SyncUser.SKUCapabilityStatusGetter(propertyBag);

            return(assignedCapabilityStatus != null && assignedCapabilityStatus == AssignedCapabilityStatus.Enabled);
        }
Пример #7
0
 internal static object AddOnSKUCapabilityGetter(IPropertyBag propertyBag)
 {
     return(SyncUser.GetEffectiveAddOnSKUCapabilities(propertyBag));
 }