protected override UIValidationError[] GetValidationErrors()
        {
            List <UIValidationError> list = new List <UIValidationError>();

            if (this.checkBox.Checked && CheckedPickerLauncherTextBox.isInitializedValueOfSelectedValue(this.SelectedValue))
            {
                UIValidationError item = new UIValidationError(Strings.SelectValueErrorMessage, this.pickerLauncherTextBox);
                list.Add(item);
            }
            return(list.ToArray());
        }
예제 #2
0
        public override bool Equals(object right)
        {
            if (right == null)
            {
                return(false);
            }
            if (object.ReferenceEquals(this, right))
            {
                return(true);
            }
            if (base.GetType() != right.GetType())
            {
                return(false);
            }
            UIValidationError uivalidationError = right as UIValidationError;

            return(string.Compare(this.Description, uivalidationError.Description) == 0 && this.ErrorProviderAnchor == uivalidationError.ErrorProviderAnchor);
        }
        protected override UIValidationError[] GetValidationErrors()
        {
            UIValidationError uivalidationError = null;

            if (!this.clearingError)
            {
                if (this.customDomainRadioButton.Checked)
                {
                    if (string.IsNullOrEmpty(this.customDomainTextBox.Text))
                    {
                        uivalidationError = new UIValidationError(Strings.ErrorDomainPartCannotBeEmpty, this.customDomainTextBox);
                        goto IL_8F;
                    }
                    try
                    {
                        SmtpDomain.Parse(this.customDomainTextBox.Text);
                        goto IL_8F;
                    }
                    catch (FormatException ex)
                    {
                        uivalidationError = new UIValidationError(new LocalizedString(ex.Message), this.customDomainTextBox);
                        goto IL_8F;
                    }
                }
                if (string.IsNullOrEmpty(this.acceptedDomainPickerLauncherTextBox.Text))
                {
                    uivalidationError = new UIValidationError(Strings.ErrorDomainPartCannotBeEmpty, this.acceptedDomainPickerLauncherTextBox);
                }
            }
IL_8F:
            if (uivalidationError != null)
            {
                return(new UIValidationError[]
                {
                    uivalidationError
                });
            }
            return(UIValidationError.None);
        }