コード例 #1
0
 public void AddValidatorControl(ValidateRenderControl control)
 {
     if (control != null)
     {
         this.Controls.Add(control);
     }
 }
コード例 #2
0
        internal override ValidateRenderControl GenerateAppendScript()
        {
            ValidateRenderControl control = new ValidateRenderControl();

            control.Text = string.Format(CultureInfo.InvariantCulture, "appendValid(new MoneyRangeValidator('{0}', {1}, {2}, '{3}', '{4}'));", new object[] { base.Owner.TargetClientId, MinValue, MaxValue, ErrorMessage, string.Empty });
            return(control);
        }
コード例 #3
0
ファイル: ValidatorContainer.cs プロジェクト: davinx/himedi
 public void AddValidatorControl(ValidateRenderControl control)
 {
     if (control != null)
     {
         Controls.Add(control);
     }
 }
コード例 #4
0
        internal override ValidateRenderControl GenerateInitScript()
        {
            ValidateRenderControl control = new ValidateRenderControl();

            control.Text = string.Format(CultureInfo.InvariantCulture, "initValid(new InputValidator('{0}', 1, 10, {1}, '{2}', '{3}', '{4}'))", new object[] { base.Owner.TargetClientId, base.Owner.Nullable ? "true" : "false", @"(0|(0+(\\.[0-9]{1,2}))|[1-9]\\d*(\\.\\d{1,2})?)", string.Empty, ErrorMessage });
            return(control);
        }
コード例 #5
0
        internal override ValidateRenderControl GenerateInitScript()
        {
            ValidateRenderControl control = new ValidateRenderControl();

            control.Text = string.Format(CultureInfo.InvariantCulture, "initValid(new InputValidator('{0}', {1}, {2}, {3}, {4}, '{5}', '{6}'))", new object[] { base.Owner.TargetClientId, LowerBound, UpperBound, base.Owner.Nullable ? "true" : "false", string.IsNullOrEmpty(Regex) ? "null" : ("'" + Regex + "'"), string.Empty, ErrorMessage });
            return(control);
        }
コード例 #6
0
 internal override ValidateRenderControl GenerateInitScript()
 {
     ValidateRenderControl control = new ValidateRenderControl();
     WebControl control2 = (WebControl) base.Owner.NamingContainer.FindControl(DestinationId);
     if (control2 != null)
     {
         control.Text = string.Format(CultureInfo.InvariantCulture, "initValid(new CompareValidator('{0}', '{1}', '{2}'));", new object[] { base.Owner.TargetClientId, control2.ClientID, ErrorMessage });
     }
     return control;
 }
コード例 #7
0
        internal override ValidateRenderControl GenerateInitScript()
        {
            ValidateRenderControl control  = new ValidateRenderControl();
            WebControl            control2 = (WebControl)base.Owner.NamingContainer.FindControl(this.DestinationId);

            if (control2 != null)
            {
                control.Text = string.Format(CultureInfo.InvariantCulture, "initValid(new CompareValidator('{0}', '{1}', '{2}'));", new object[] { base.Owner.TargetClientId, control2.ClientID, this.ErrorMessage });
            }
            return(control);
        }
コード例 #8
0
 internal override ValidateRenderControl GenerateInitScript()
 {
     ValidateRenderControl control = new ValidateRenderControl();
     WebControl control2 = (WebControl) base.Owner.NamingContainer.FindControl(base.Owner.ControlToValidate);
     if (control2 != null)
     {
         control2.Attributes.Add("groupname", base.Owner.TargetClientId);
         control.Text = string.Format(CultureInfo.InvariantCulture, "initValid(new SelectValidator('{0}', {1}, '{2}'))", new object[] { base.Owner.TargetClientId, base.Owner.Nullable ? "true" : "false", this.ErrorMessage });
     }
     return control;
 }
コード例 #9
0
        internal override ValidateRenderControl GenerateInitScript()
        {
            ValidateRenderControl control  = new ValidateRenderControl();
            WebControl            control2 = (WebControl)base.Owner.NamingContainer.FindControl(base.Owner.ControlToValidate);

            if (control2 != null)
            {
                control2.Attributes.Add("groupname", base.Owner.TargetClientId);
                control.Text = string.Format(CultureInfo.InvariantCulture, "initValid(new SelectValidator('{0}', {1}, '{2}'))", new object[] { base.Owner.TargetClientId, base.Owner.Nullable ? "true" : "false", ErrorMessage });
            }
            return(control);
        }
コード例 #10
0
        internal override ValidateRenderControl GenerateInitScript()
        {
            ValidateRenderControl control = new ValidateRenderControl {
                Text = string.Format(CultureInfo.InvariantCulture, "initValid(new InputValidator('{0}', 1, 10, {1}, '{2}', '{3}', '{4}'", new object[] { base.Owner.TargetClientId, base.Owner.Nullable ? "true" : "false", @"(0|-?[0-9]\\d*(\\.\\d{1,2})?)", base.Owner.Nullable ? base.Owner.FocusMessage : (base.Owner.RequiredAlt + "<br/>" + base.Owner.FocusMessage), base.Owner.Nullable ? this.ErrorMessage : (base.Owner.RequiredMessage + "<br/>" + this.ErrorMessage) })
            };

            if (base.Owner.Nullable)
            {
                control.Text = control.Text + string.Format(CultureInfo.InvariantCulture, ", '{0}'", new object[] { base.Owner.NullMessage });
            }
            control.Text = control.Text + "));";
            return(control);
        }
コード例 #11
0
 internal override ValidateRenderControl GenerateInitScript()
 {
     ValidateRenderControl control = new ValidateRenderControl
     {
         Text = string.Format(CultureInfo.InvariantCulture, "initValid(new InputValidator('{0}', {1}, {2}, {3}, {4}, '{5}', '{6}'", new object[] { base.Owner.TargetClientId, this.LowerBound, this.UpperBound, base.Owner.Nullable ? "true" : "false", string.IsNullOrEmpty(this.Regex) ? "null" : ("'" + this.Regex + "'"), base.Owner.Nullable ? base.Owner.FocusMessage : (base.Owner.RequiredAlt + "<br/>" + base.Owner.FocusMessage), base.Owner.Nullable ? this.ErrorMessage : (base.Owner.RequiredMessage + "<br/>" + this.ErrorMessage) })
     };
     if (base.Owner.Nullable)
     {
         control.Text = control.Text + string.Format(CultureInfo.InvariantCulture, ", '{0}'", new object[] { base.Owner.NullMessage });
     }
     control.Text = control.Text + "));";
     return control;
 }
コード例 #12
0
 internal override ValidateRenderControl GenerateInitScript()
 {
     ValidateRenderControl control = new ValidateRenderControl
     {
         Text = string.Format(CultureInfo.InvariantCulture, "initValid(new InputValidator('{0}', 1, 10, {1}, '{2}', '{3}', '{4}'", new object[] { base.Owner.TargetClientId, base.Owner.Nullable ? "true" : "false", @"-?[0-9]\\d*", base.Owner.Nullable ? base.Owner.FocusMessage : (base.Owner.RequiredAlt + "<br/>" + base.Owner.FocusMessage), base.Owner.Nullable ? this.ErrorMessage : (base.Owner.RequiredMessage + "<br/>" + this.ErrorMessage) })
     };
     if (base.Owner.Nullable)
     {
         control.Text = control.Text + string.Format(CultureInfo.InvariantCulture, ", '{0}'", new object[] { base.Owner.NullMessage });
     }
     control.Text = control.Text + "));";
     return control;
 }
コード例 #13
0
        internal override ValidateRenderControl GenerateInitScript()
        {
            ValidateRenderControl control = new ValidateRenderControl {
                Text = string.Format(CultureInfo.InvariantCulture, "initValid(new InputValidator('{0}', {1}, {2}, {3}, {4}, '{5}', '{6}'", new object[] { base.Owner.TargetClientId, this.LowerBound, this.UpperBound, base.Owner.Nullable ? "true" : "false", string.IsNullOrEmpty(this.Regex) ? "null" : ("'" + this.Regex + "'"), base.Owner.Nullable ? base.Owner.FocusMessage : (base.Owner.RequiredAlt + "<br/>" + base.Owner.FocusMessage), base.Owner.Nullable ? this.ErrorMessage : (base.Owner.RequiredMessage + "<br/>" + this.ErrorMessage) })
            };

            if (base.Owner.Nullable)
            {
                control.Text = control.Text + string.Format(CultureInfo.InvariantCulture, ", '{0}'", new object[] { base.Owner.NullMessage });
            }
            control.Text = control.Text + "));";
            return(control);
        }
コード例 #14
0
 internal override ValidateRenderControl GenerateAppendScript()
 {
     ValidateRenderControl control = new ValidateRenderControl();
     control.Text = string.Format(CultureInfo.InvariantCulture, "appendValid(new MoneyRangeValidator('{0}', {1}, {2}, '{3}', '{4}'));", new object[] { base.Owner.TargetClientId, MinValue, MaxValue, ErrorMessage, string.Empty });
     return control;
 }
コード例 #15
0
 internal override ValidateRenderControl GenerateInitScript()
 {
     ValidateRenderControl control = new ValidateRenderControl();
     control.Text = string.Format(CultureInfo.InvariantCulture, "initValid(new InputValidator('{0}', 1, 10, {1}, '{2}', '{3}', '{4}'))", new object[] { base.Owner.TargetClientId, base.Owner.Nullable ? "true" : "false", @"(0|(0+(\\.[0-9]{1,2}))|[1-9]\\d*(\\.\\d{1,2})?)", string.Empty, ErrorMessage });
     return control;
 }
コード例 #16
0
 internal override ValidateRenderControl GenerateInitScript()
 {
     ValidateRenderControl control = new ValidateRenderControl();
     control.Text = string.Format(CultureInfo.InvariantCulture, "initValid(new InputValidator('{0}', {1}, {2}, {3}, {4}, '{5}', '{6}'))", new object[] { base.Owner.TargetClientId, LowerBound, UpperBound, base.Owner.Nullable ? "true" : "false", string.IsNullOrEmpty(Regex) ? "null" : ("'" + Regex + "'"), string.Empty, ErrorMessage });
     return control;
 }