// Token: 0x06000AF4 RID: 2804 RVA: 0x00031F74 File Offset: 0x00030174 internal static PropertyConstraintViolationError ValidateWhenMailboxCreated(object value, PropertyDefinition propertyDefinition, IPropertyBag propertyBag, PropertyDefinitionConstraint owner) { if (propertyBag[propertyDefinition] != null && (DateTime)propertyBag[propertyDefinition] != (DateTime)value) { return(new PropertyConstraintViolationError(DirectoryStrings.ErrorNotResettableProperty(propertyDefinition.Name, propertyBag[propertyDefinition].ToString()), propertyDefinition, value, owner)); } return(null); }
// Token: 0x06000AF2 RID: 2802 RVA: 0x00031E60 File Offset: 0x00030060 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: 0x06000AF3 RID: 2803 RVA: 0x00031F04 File Offset: 0x00030104 internal static PropertyConstraintViolationError ValidateOrganizationCapabilities(IEnumerable collection, PropertyDefinition propertyDefinition, IPropertyBag propertyBag, PropertyDefinitionConstraint owner) { if (collection == null) { return(null); } foreach (object obj in collection) { if ((Capability)obj == Capability.None) { return(new PropertyConstraintViolationError(DirectoryStrings.ErrorCapabilityNone, propertyDefinition, obj, owner)); } } return(null); }
// Token: 0x06000AF0 RID: 2800 RVA: 0x00031DC8 File Offset: 0x0002FFC8 internal static PropertyConstraintViolationError ValidateMailboxMoveFlags(object value, PropertyDefinition propertyDefinition, IPropertyBag propertyBag, PropertyDefinitionConstraint owner) { if (value == null) { return(null); } RequestFlags requestFlags = (RequestFlags)value; if (requestFlags == RequestFlags.None) { return(null); } bool flag = (requestFlags & RequestFlags.CrossOrg) != RequestFlags.None; bool flag2 = (requestFlags & RequestFlags.IntraOrg) != RequestFlags.None; bool flag3 = (requestFlags & RequestFlags.Pull) != RequestFlags.None; bool flag4 = (requestFlags & RequestFlags.Push) != RequestFlags.None; if (flag == flag2 || flag3 == flag4) { return(new PropertyConstraintViolationError(DirectoryStrings.InvalidMailboxMoveFlags(value), propertyDefinition, value, owner)); } return(null); }
// Token: 0x06000AF1 RID: 2801 RVA: 0x00031E28 File Offset: 0x00030028 internal static PropertyConstraintViolationError ValidateHostname(object value, PropertyDefinition propertyDefinition, IPropertyBag propertyBag, PropertyDefinitionConstraint owner) { string text = (string)value; if (string.IsNullOrEmpty(text)) { return(null); } Hostname hostname; if (!Hostname.TryParse(text, out hostname)) { return(new PropertyConstraintViolationError(DirectoryStrings.InvalidHostname(text), propertyDefinition, value, owner)); } return(null); }
// Token: 0x06000AEF RID: 2799 RVA: 0x00031D78 File Offset: 0x0002FF78 internal static PropertyConstraintViolationError ValidateClientVersion(object value, PropertyDefinition propertyDefinition, IPropertyBag propertyBag, PropertyDefinitionConstraint owner) { try { new MapiVersionRanges((string)value); return(null); } catch (FormatException) { } catch (ArgumentOutOfRangeException) { } return(new PropertyConstraintViolationError(DirectoryStrings.BlockedOutlookClientVersionPatternDescription, propertyDefinition, value, owner)); }
// Token: 0x06000AEE RID: 2798 RVA: 0x00031D38 File Offset: 0x0002FF38 internal static PropertyConstraintViolationError ValidateConfigReadScope(object value, PropertyDefinition propertyDefinition, IPropertyBag propertyBag, PropertyDefinitionConstraint owner) { if (propertyBag != null) { ScopeType scopeType = (ScopeType)value; ScopeType scopeType2 = scopeType; switch (scopeType2) { case ScopeType.None: case ScopeType.NotApplicable: break; default: if (scopeType2 != ScopeType.OrganizationConfig) { return(new PropertyConstraintViolationError(DirectoryStrings.InvalidConfigScope(value), propertyDefinition, value, owner)); } break; } return(null); } return(null); }
// Token: 0x06000AE6 RID: 2790 RVA: 0x00031A08 File Offset: 0x0002FC08 internal static PropertyConstraintViolationError ValidateUserSamAccountNameIncludeNoAt(object value, PropertyDefinition propertyDefinition, IPropertyBag propertyBag, PropertyDefinitionConstraint owner) { if (propertyBag != null) { MultiValuedProperty <string> multiValuedProperty = (MultiValuedProperty <string>)propertyBag[ADObjectSchema.ObjectClass]; if (multiValuedProperty.Count > 0 && multiValuedProperty.Contains("user")) { string text = value as string; if (!string.IsNullOrEmpty(text) && -1 != text.IndexOf('@')) { return(new PropertyConstraintViolationError(DirectoryStrings.ErrorUserAccountNameIncludeAt, propertyDefinition, value, owner)); } } } return(null); }
// Token: 0x06000AED RID: 2797 RVA: 0x00031CDC File Offset: 0x0002FEDC internal static PropertyConstraintViolationError ValidateDomainScope(object value, PropertyDefinition propertyDefinition, IPropertyBag propertyBag, PropertyDefinitionConstraint owner) { if (propertyBag != null) { switch ((ScopeType)value) { case ScopeType.OU: case ScopeType.CustomRecipientScope: case ScopeType.OrganizationConfig: case ScopeType.CustomConfigScope: case ScopeType.PartnerDelegatedTenantScope: case ScopeType.ExclusiveRecipientScope: case ScopeType.ExclusiveConfigScope: return(new PropertyConstraintViolationError(DirectoryStrings.InvalidRecipientScope(value), propertyDefinition, value, owner)); } return(null); } return(null); }
public virtual ValidatorInfo Create(ProviderPropertyDefinition propertyDefinition, PropertyDefinitionConstraint constraint) { if (this.ValidatorType.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[] { this.ConstraintType }, null) != null) { return((ValidatorInfo)Activator.CreateInstance(this.ValidatorType, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new object[] { constraint }, null)); } if (this.ValidatorType.GetConstructor(BindingFlags.Instance | BindingFlags.Public, null, new Type[0], null) != null) { return((ValidatorInfo)Activator.CreateInstance(this.ValidatorType, true)); } return(null); }