예제 #1
0
        public bool Verify()
        {
            Debug.Check(_property != null);

            string propertyName = this.nameTextBox.Text;

            bool isValid = !string.IsNullOrEmpty(propertyName) && propertyName.Length >= 1 &&
                           char.IsLetter(propertyName[0]) && (_property.Type != null);

            if (isValid && _agent != null)
            {
                PropertyDef prop = _agent.GetPropertyByName(propertyName);

                if (_isNew)
                {
                    isValid = (prop == null);
                }
                else
                {
                    isValid = (prop == null || prop == _originalProperty);
                }
            }

            return(isValid);
        }