internal static PropertyConstraintViolationError ValidateCapabilities(IEnumerable collection, PropertyDefinition propertyDefinition, IPropertyBag propertyBag, PropertyDefinitionConstraint owner) { if (collection == null) { return(null); } List <Capability> list = new List <Capability>(); foreach (object obj in collection) { Capability capability = (Capability)obj; if (capability == Capability.None) { return(new PropertyConstraintViolationError(DirectoryStrings.ErrorCapabilityNone, propertyDefinition, obj, owner)); } if (CapabilityHelper.IsRootSKUCapability(capability)) { list.Add(capability); } } if (list.Count > 1) { return(new PropertyConstraintViolationError(DirectoryStrings.ErrorMoreThanOneSKUCapability(MultiValuedPropertyBase.FormatMultiValuedProperty(list)), propertyDefinition, collection, owner)); } return(null); }
// Token: 0x060009F0 RID: 2544 RVA: 0x0002CF9B File Offset: 0x0002B19B internal static bool AllowMailboxLogon(Capability?skuCapability, bool?skuAssigned, DateTime?whenMailboxCreated) { if (skuCapability != null && CapabilityHelper.IsFreeSkuCapability(skuCapability.Value)) { return(true); } if (skuAssigned != null) { return(skuAssigned.Value); } return(CapabilityHelper.IsWithinGracePeriod(whenMailboxCreated)); }
// Token: 0x060009EC RID: 2540 RVA: 0x0002CCC8 File Offset: 0x0002AEC8 internal static void SetSKUCapabilities(string sourceName, MultiValuedProperty <Capability> sourceCapabilities, MultiValuedProperty <Capability> targetCapabilities) { List <Capability> rootSKUCapabilities = CapabilityHelper.GetRootSKUCapabilities(sourceCapabilities); CapabilityHelper.SetSKUCapability((rootSKUCapabilities.Count == 0) ? null : new Capability?(rootSKUCapabilities[0]), targetCapabilities); foreach (Capability item in sourceCapabilities) { if (CapabilityHelper.AddOnSKUCapabilities.Contains(item) && !targetCapabilities.Contains(item)) { targetCapabilities.Add(item); } } }
// Token: 0x060009ED RID: 2541 RVA: 0x0002CD78 File Offset: 0x0002AF78 internal static void SetAddOnSKUCapabilities(MultiValuedProperty <Capability> sourceCapabilities, MultiValuedProperty <Capability> targetCapabilities) { if (!sourceCapabilities.All((Capability c) => CapabilityHelper.IsAddOnSKUCapability(c))) { throw new ArgumentOutOfRangeException("sourceCapabilities", sourceCapabilities, DirectoryStrings.ExArgumentOutOfRangeException("sourceCapabilities", sourceCapabilities)); } foreach (Capability item in from c in CapabilityHelper.AddOnSKUCapabilities where targetCapabilities.Contains(c) select c) { targetCapabilities.Remove(item); } foreach (Capability item2 in sourceCapabilities) { targetCapabilities.Add(item2); } }
// Token: 0x060009EF RID: 2543 RVA: 0x0002CF80 File Offset: 0x0002B180 internal static bool HasBposSKUCapability(MultiValuedProperty <Capability> capabilities) { return(CapabilityHelper.GetSKUCapability(capabilities) != null); }