/// <summary>
        /// Registers the <see cref="ErrorLabel"/> with the <see cref="ModelBoundForm"/> so that it may be displayed.
        /// </summary>
        /// <param name="errorLabel"></param>
        protected void Register(ErrorLabel errorLabel)
        {
            _errorLabels.Add(errorLabel.Control.Name, errorLabel);
            Controls.Add(errorLabel);

            //todo: I don't care for this much. Add support for other types of input
            errorLabel.Control.Validating += (sender, args) => ValidateControl(errorLabel.Control, "Text");
        }
Esempio n. 2
0
        /// <summary>
        /// Registers the <see cref="ErrorLabel"/> with the <see cref="ModelBoundForm"/> so that it may be displayed.
        /// </summary>
        /// <param name="errorLabel"></param>
        protected void Register(ErrorLabel errorLabel)
        {
            _errorLabels.Add(errorLabel.Control.Name, errorLabel);
            Controls.Add(errorLabel);

            //todo: I don't care for this much. Add support for other types of input
            errorLabel.Control.Validating += (sender, args) => ValidateControl(errorLabel.Control, "Text");
        }
Esempio n. 3
0
        public static new ErrorLabel For(Forms.Control control, Alignment alignment, int padding)
        {
            var errorLabel = new ErrorLabel(control)
            {
                ForeColor = Color.Red,
                AutoSize  = true,
                Visible   = true
            };

            SetAlignment(errorLabel, control, alignment, padding);

            errorLabel.BringToFront();

            return(errorLabel);
        }
Esempio n. 4
0
        public static new ErrorLabel For(Forms.Control control, Alignment alignment, int padding)
        {
            var errorLabel = new ErrorLabel(control)
            {
                ForeColor = Color.Red,
                AutoSize = true,
                Visible = true
            };

            SetAlignment(errorLabel, control, alignment, padding);

            errorLabel.BringToFront();

            return errorLabel;
        }
Esempio n. 5
0
 public static new ErrorLabel For(Forms.Control control, Alignment alignment)
 {
     return(ErrorLabel.For(control, alignment, DefaultPadding));
 }
Esempio n. 6
0
 public static new ErrorLabel For(Forms.Control control)
 {
     return(ErrorLabel.For(control, Alignment.Right));
 }