OSAE.UI.Controls.AddControlPropertyLabel.validateForm C# (CSharp) Method

validateForm() private method

private validateForm ( string mthd ) : bool
mthd string
return bool
        private bool validateForm(string mthd)
        {
            bool validate = true;
            // Does this object already exist
            if (mthd == "Add" || sOriginalName != txtControlName.Text)
            {
                try
                {
                    OSAEObject oExist = OSAEObjectManager.GetObjectByName(txtControlName.Text);
                    if (oExist != null)
                    {
                        MessageBox.Show("Control name already exist. Please Change!");
                        validate = false;
                    }
                }
                catch { }
            }
            if (string.IsNullOrEmpty(txtControlName.Text))
            {
                MessageBox.Show("You must enter a name for this control!");
                validate = false;
            }
            if (string.IsNullOrEmpty(cboObject.Text))
            {
                MessageBox.Show("You must choose an associated object!");
                validate = false;
            }
            if (string.IsNullOrEmpty(cboProperty.Text))
            {
                MessageBox.Show("You must choose a Property!");
                validate = false;
            }
            if (string.IsNullOrEmpty(txtX.Text))
            {
                MessageBox.Show("X Can not be empty");
                validate = false;
            }
            if (string.IsNullOrEmpty(txtY.Text))
            {
                MessageBox.Show("Y Can not be empty");
                validate = false;
            }
            if (string.IsNullOrEmpty(txtZOrder.Text))
            {
                MessageBox.Show("ZOrder can not be empty");
                validate = false;
            }

            return validate;
        }