예제 #1
0
        protected virtual bool CancelNameChanged(EntityNameChangeEventArgs e)
        {
            if (_entityNameChanged != null)
            {
                _entityNameChanged(e);
                return(e.Cancel);
            }

            return(false);
        }
예제 #2
0
        protected virtual bool CancelNameChanged(string newValue)
        {
            if (_nameChanged != null)
            {
                EntityNameChangeEventArgs e = new EntityNameChangeEventArgs(this, newValue, _name);
                _nameChanged(e);
                return(e.Cancel);
            }

            return(false);
        }
예제 #3
0
        void item_NameChanged(EntityNameChangeEventArgs e)
        {
            if (e.NewValue == null)
            {
                e.Cancel = true;
                return;
            }

            if (Contains(e.NewValue))
            {
                e.Cancel = true;
                return;
            }

            if (CancelNameChanged(e))
            {
                return;
            }
        }