Exemple #1
0
        private void ShowFieldError(string fieldName)
        {
            ControlMessage controlMessage = _fields[fieldName];
            string         message        = controlMessage.Message;

            if (message.Trim().Length > 0)
            {
                StatusMessage = message;
            }
        }
Exemple #2
0
 public void ClearErrors()
 {
     StatusMessage = string.Empty;
     foreach (KeyValuePair <string, ControlMessage> pair in _fields)
     {
         ControlMessage controlMessage = pair.Value;
         controlMessage.Message = string.Empty;
         Control control = controlMessage.Control;
         control.BackColor = SystemColors.Control;
     }
     _errorCount = 0;
 }
Exemple #3
0
 private void RestoreFirstError()
 {
     foreach (KeyValuePair <string, ControlMessage> pair in _fields)
     {
         ControlMessage controlMessage = pair.Value;
         string         message        = controlMessage.Message;
         if (message.Trim().Length > 0)
         {
             StatusMessage = message;
             break;
         }
     }
 }
Exemple #4
0
        public void SetFieldError(string fieldName, string message)
        {
            ControlMessage controlMessage = _fields[fieldName];

            controlMessage.Message = message;
            Control control = controlMessage.Control;

            control.BackColor = Color.Pink;
            _errorCount++;
            if (_errorCount == 1)
            {
                control.Focus();
                StatusMessage = message;
            }
        }