예제 #1
0
        private void textBoxAlias_TextChanged(object sender, EventArgs e)
        {
            errorProvider.Clear();
            string failReason;

            string originalAlias = _primaryRelationship.Alias;

            _primaryRelationship.Alias = textBoxAlias.Text.Trim();

            if (!_primaryRelationship.AliasValidate(_primaryRelationship, out failReason))
            {
                //textBoxAliasPlural.Text = _primaryRelationship.AliasPluralDefault(_primaryRelationship);
                _primaryRelationship.Alias = originalAlias;
                errorProvider.SetError(textBoxAlias, failReason);
                textBoxAlias.BackColor = ErrorBackColor;
                //e.Cancel = true;
                return;
            }
            //textBoxAliasPlural.Text = _primaryRelationship.AliasPluralDefault(_primaryRelationship);
            _primaryRelationship.Alias = originalAlias; // Reset, so we don't inadvertantly save
            textBoxAlias.BackColor     = Color.White;
        }