private ValidationError ConvertMappingProperty(ValidationError error, object dataObject, DataTable table) { ValidationError result = error; PropertyValidationError propertyValidationError = error as PropertyValidationError; if (propertyValidationError != null) { string columnNameThruMappingProperty = this.GetColumnNameThruMappingProperty(propertyValidationError.PropertyDefinition.Name, table, dataObject); if (!string.IsNullOrEmpty(columnNameThruMappingProperty)) { PropertyDefinition propertyDefinition = new AdminPropertyDefinition(columnNameThruMappingProperty, ExchangeObjectVersion.Exchange2003, typeof(bool), true, PropertyDefinitionConstraint.None, PropertyDefinitionConstraint.None); result = new PropertyValidationError(propertyValidationError.Description, propertyDefinition, propertyValidationError.InvalidData); } } return(result); }
public override ValidationError[] Validate() { ValidationError[] collection = base.Validate(); List <ValidationError> list = new List <ValidationError>(collection); PropertyDefinition propertyDefinition = new AdminPropertyDefinition(this.BindingProperty, ExchangeObjectVersion.Exchange2003, typeof(string), null, PropertyDefinitionConstraint.None, PropertyDefinitionConstraint.None); try { this.ProxyAddressBase = this.GetValidatedProxyAddressBase(this.Prefix, this.Address); if (this.ProxyAddressBase != this.OriginalProxyAddressBase && this.ProxyAddresses.Contains(this.ProxyAddressBase)) { list.Add(new PropertyValidationError(Strings.ProxyAddressExistedError, propertyDefinition, null)); } } catch (ArgumentException ex) { list.Add(new PropertyValidationError(new LocalizedString(ex.Message), propertyDefinition, null)); } return(list.ToArray()); }