public bool EmptyValidate(Control ctl)
        {
            IRyanControl c = ctl as IRyanControl;

            _ValidateState = true;
            if (!c.AllowEmpty)
            {
                if ((c.RemoveSpace && ctl.Text.Trim() == "") || ctl.Text == "")
                {
                    c.EmptyMessage = "输入不能为空!";
                    ShowErrorMessage(ctl, c.EmptyMessage);
                    c.SelectAll();
                    //ctl.Focus();
                    _ValidateState = false;
                    return(false);
                }
                else
                {
                    if (_tooltip != null)
                    {
                        _tooltip.Dispose();
                    }
                }
            }
            else
            {
                if (_tooltip != null)
                {
                    _tooltip.Dispose();
                }
            }
            return(true);
        }
        private static bool RegexExpressionValidate(Control ctl)
        {
            IRyanControl c = ctl as IRyanControl;

            if (!((c.RemoveSpace && ctl.Text.Trim() == "") || ctl.Text == ""))
            {
                if (!string.IsNullOrEmpty(c.RegexExpression) &&
                    !Regex.IsMatch((c.RemoveSpace ? ctl.Text.Trim() : ctl.Text),
                                   c.RegexExpression))
                {
                    ShowErrorMessage(ctl, c.ErrorMessage);
                    c.SelectAll();
                    ctl.Focus();
                    return(false);
                }
            }

            return(true);
        }
        private bool InputTypeValidate(Control ctl)
        {
            IRyanControl c = ctl as IRyanControl;

            switch (_InputType)
            {
            case EMInputTypes.文本:
                _ValidateState = true;
                break;

            case EMInputTypes.数字:
                ctl.Text          = StringCS.ToDBC(ctl.Text);
                c.RegexExpression = "^([0-9]{1,})$";
                c.ErrorMessage    = "请输入整数数字。格式:[0-9]!";
                _ValidateState    = RegexExpressionValidate(ctl);
                break;

            case EMInputTypes.货币:
                ctl.Text          = ChgDot(StringCS.ToDBC(ctl.Text));
                c.RegexExpression = "^([1-9]\\d*|0)(\\.\\d+)?$";
                c.ErrorMessage    = "请输入货币类型。格式[9999999999.9999]!";
                _ValidateState    = RegexExpressionValidate(ctl);
                break;

            case EMInputTypes.日期:
                ctl.Text = StringCS.ToDBC(ctl.Text);
                //c.RegexExpression = "^[+-]?\\d*[.]?\\d*$";
                //c.ErrorMessage = "请输入日期类型。格式[2000-01-01]!";
                //_ValidateState = RegexExpressionValidate(ctl);
                DateTime _dt = DateTime.Now;
                if (DateTime.TryParse(ctl.Text, out _dt))
                {
                    _ValidateState = true;
                }
                else
                {
                    c.ErrorMessage = "请输入日期类型。格式[2000-01-01]!";
                    ShowErrorMessage(ctl, c.ErrorMessage);
                    c.SelectAll();
                    _ValidateState = false;
                }
                break;

            case EMInputTypes.身份证:
                ctl.Text = StringCS.ToDBC(ctl.Text);
                if (IDCardValidation.CheckIDCard(ctl.Text))
                {
                    _ValidateState = true;
                }
                else
                {
                    c.ErrorMessage = "请输入正确的身份证号码。";
                    _ValidateState = false;
                }
                break;

            case EMInputTypes.手机号:
                ctl.Text          = StringCS.ToDBC(ctl.Text);
                c.RegexExpression = "^(13|14|15|17|18)\\d{9}$";
                c.ErrorMessage    = "请输入正确的手机号。";
                _ValidateState    = RegexExpressionValidate(ctl);
                break;

            case EMInputTypes.IP地址:
                ctl.Text          = StringCS.ToDBC(ctl.Text);
                c.RegexExpression = "^((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)$";
                c.ErrorMessage    = "请输入正确格式的IP地址。格式[202.202.202.202]。";
                _ValidateState    = RegexExpressionValidate(ctl);
                break;

            default:
                _ValidateState = true;
                break;
            }
            return(_ValidateState);
        }