- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
//Dictionary used to check if eventValues are unique
Dictionary<string, string> uniqueEventValues = new Dictionary<string, string>();
//... заполняем коллекцию
try {
uniqueEventValues.Add(eventValue, "X");
}
catch (Exception ex) {
if (ex.Message.Equals("An item with the same key has already been added.")) {
msgAddEventParams.Text = "EventValues must be unique. " + eventValue + " is duplicate.";
msgAddEventParams.Visible = true;
return;
}
}