Editor no longer allows to enter duplicate keywords.

This commit is contained in:
Dario Solera 2011-07-23 11:54:52 +02:00
parent f4c18fda33
commit 262086e997
2 changed files with 10 additions and 6 deletions

View file

@ -16,5 +16,5 @@ using System.Reflection;
// //
// You can specify all the values or you can default the Revision and Build Numbers // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("3.0.5.601")] [assembly: AssemblyVersion("3.0.5.602")]
[assembly: AssemblyFileVersion("3.0.5.601")] [assembly: AssemblyFileVersion("3.0.5.602")]

View file

@ -687,10 +687,14 @@ namespace ScrewTurn.Wiki {
/// </summary> /// </summary>
/// <returns>The keywords.</returns> /// <returns>The keywords.</returns>
private string[] GetKeywords() { private string[] GetKeywords() {
string[] keywords = txtKeywords.Text.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); var keywords = txtKeywords.Text.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
for(int i = 0; i < keywords.Length; i++) {
keywords[i] = keywords[i].Trim(); keywords =
} (from k in keywords
select k.Trim())
.Distinct(StringComparer.OrdinalIgnoreCase)
.ToArray();
return keywords; return keywords;
} }