/// <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");
        }
Пример #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");
        }
Пример #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);
        }
Пример #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;
        }
Пример #5
0
 public static new ErrorLabel For(Forms.Control control, Alignment alignment)
 {
     return(ErrorLabel.For(control, alignment, DefaultPadding));
 }
Пример #6
0
 public static new ErrorLabel For(Forms.Control control)
 {
     return(ErrorLabel.For(control, Alignment.Right));
 }