private void showErrorsButton_Click(object sender, EventArgs e) { if (_currentSource == null) { return; } var duplicateTokens = _currentSource.GetDuplicateTokens(); var notUsedTokens = _currentSource.GetNotUsedTokens(); if (duplicateTokens.Count < 1 && notUsedTokens.Count < 1) { MessageBox.Show("Ok", "", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } var result = string.Empty; if (duplicateTokens.Count > 0) { result = result.AddNewLine(string.Format("Duplicate tokens found: {0}", string.Join(", ", duplicateTokens.ToArray())), false); } if (notUsedTokens.Count > 0) { result = result.AddNewLine(string.Format("Not used tokens found: {0}", string.Join(", ", notUsedTokens.ToArray())), false); } MessageBox.Show(result, "", MessageBoxButtons.OK, MessageBoxIcon.Error); }