[longomatch] Initialize string tags with the first option



commit 260d569900d81227f25a50b827268999275cfc59
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Jan 27 21:51:30 2012 +0100

    Initialize string tags with the first option

 LongoMatch.GUI/Gui/Component/StringTaggerWidget.cs |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/StringTaggerWidget.cs b/LongoMatch.GUI/Gui/Component/StringTaggerWidget.cs
index 642c150..df692e0 100644
--- a/LongoMatch.GUI/Gui/Component/StringTaggerWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/StringTaggerWidget.cs
@@ -50,7 +50,14 @@ namespace LongoMatch.Gui.Component
 		}
 		
 		public void UpdateTags() {
-			foreach (var tag in tags.GetTags(subcategory)) {
+			List<StringTag> stringTags = tags.GetTags(subcategory);
+			
+			/* Set a default value */
+			if (stringTags.Count == 0) {
+				stringTags.Add(new StringTag{Value=subcategory[0], SubCategory=subcategory});
+			}
+			
+			foreach (var tag in stringTags) {
 				if (dict.ContainsKey(tag)) 	
 					dict[tag].Active = true;
 			}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]