Пример #1
0
        private void ShowFieldError(string fieldName)
        {
            ControlMessage controlMessage = _fields[fieldName];
            string         message        = controlMessage.Message;

            if (message.Trim().Length > 0)
            {
                StatusMessage = message;
            }
        }
Пример #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;
 }
Пример #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;
         }
     }
 }
Пример #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;
            }
        }