[longomatch/redesign2: 71/159] Add a new StringTag class



commit f23f49bb9f6d9dfbf252884211f055545ffa10b3
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Sun Jan 30 13:47:05 2011 +0100

    Add a new StringTag class

 LongoMatch/Gui/Component/TaggerWidget.cs   |    4 ++--
 LongoMatch/Gui/Component/TagsTreeWidget.cs |    6 +++---
 LongoMatch/Store/Play.cs                   |    2 +-
 LongoMatch/Store/Tag.cs                    |   17 +++++++++++++++++
 4 files changed, 23 insertions(+), 6 deletions(-)
---
diff --git a/LongoMatch/Gui/Component/TaggerWidget.cs b/LongoMatch/Gui/Component/TaggerWidget.cs
index ed58c1c..f1ce579 100644
--- a/LongoMatch/Gui/Component/TaggerWidget.cs
+++ b/LongoMatch/Gui/Component/TaggerWidget.cs
@@ -67,8 +67,8 @@ namespace LongoMatch.Gui.Component
 		}
 		
 		private void AddTagWidget(Tag tag, bool check){
-			CheckButton button = new CheckButton(tag.Value);
-			button.Name = tag.Value;
+			CheckButton button = new CheckButton(tag.Value.ToString());
+			button.Name = tag.Value.ToString();
 			AddElementToTable(button);
 			button.Active = check;
 			tagsDict.Add(tag, button);
diff --git a/LongoMatch/Gui/Component/TagsTreeWidget.cs b/LongoMatch/Gui/Component/TagsTreeWidget.cs
index 31ee648..925c64d 100644
--- a/LongoMatch/Gui/Component/TagsTreeWidget.cs
+++ b/LongoMatch/Gui/Component/TagsTreeWidget.cs
@@ -136,7 +136,7 @@ namespace LongoMatch.Gui.Component
 		public void UpdateTagsList(){
 			(tagscombobox.Model as ListStore).Clear();
 			foreach (Tag tag in project.Tags)
-				tagscombobox.AppendText(tag.Value);
+				tagscombobox.AppendText(tag.Value.ToString());
 		}
 		
 		private void AddFilterWidget(Tag tag){
@@ -145,11 +145,11 @@ namespace LongoMatch.Gui.Component
 			Label l;
 			
 			box = new HBox();
-			box.Name = tag.Value;
+			box.Name = tag.Value.ToString();
 			b = new Button();
 			b.Image =  new Image(Stetic.IconLoader.LoadIcon(this, "gtk-delete", Gtk.IconSize.Menu));
 			b.Clicked += OnDeleteClicked;
-			l = new Label(tag.Value);
+			l = new Label(tag.Value.ToString());
 			l.Justify = Justification.Left;
 			box.PackEnd(b,false,  false, 0);
 			box.PackStart(l,true, true, 0);
diff --git a/LongoMatch/Store/Play.cs b/LongoMatch/Store/Play.cs
index 0239ab0..d2866c2 100644
--- a/LongoMatch/Store/Play.cs
+++ b/LongoMatch/Store/Play.cs
@@ -179,7 +179,7 @@ namespace LongoMatch.Store
 			String[] tags = new String[Tags.Count];
 		
 			for (int i=0; i<Tags.Count; i++)
-				tags[i] = Tags[i].Value;
+				tags[i] = Tags[i].Value.ToString();
 			
 			return  "<b>"+Catalog.GetString("Name")+": </b>"+Name+"\n"+
 					"<b>"+Catalog.GetString("Start")+": </b>"+Start.ToMSecondsString()+"\n"+
diff --git a/LongoMatch/Store/Tag.cs b/LongoMatch/Store/Tag.cs
index b810078..25a8ca5 100644
--- a/LongoMatch/Store/Tag.cs
+++ b/LongoMatch/Store/Tag.cs
@@ -33,6 +33,23 @@ namespace LongoMatch.Store
 			set;
 		}
 		
+		public object Value {
+			get;
+			set;
+		}
+	}
+	
+	[Serializable]
+	public class StringTag
+	{
+		public StringTag() {
+		}
+
+		public string Name {
+			get;
+			set;
+		}
+		
 		public string Value {
 			get;
 			set;



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