Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Enum Fields { Unknown = 0, Username = 1 << 0, Password = 1 << 1, Email 1 << 2...etc }
- Dictionary<Fields, List<string>> errors = new Dictionary<Fields, List<string>>();
- Fields mask = Fields.UserName | Fields.Password;
- errors[mask] = "Input is empty";
- List<string> errMsgs = errors[Fields.UserName];
- // to get a list of all error messages associated with Fields.UserName
- // including the one just entered. A lookup on Fields.Password would
- // return the same entry
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement