private void ShowFieldError(string fieldName) { ControlMessage controlMessage = _fields[fieldName]; string message = controlMessage.Message; if (message.Trim().Length > 0) { StatusMessage = message; } }
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; }
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; } } }
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; } }