[longomatch/redesign: 45/96] Add subcategories templates



commit c611169dea26b5aa7345fe2ccd0058b805c217e7
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Thu Jan 13 01:15:07 2011 +0100

    Add subcategories templates

 LongoMatch/LongoMatch.mdp                          |    3 +-
 .../{TagsTemplate.cs => SubCategoriesTemplates.cs} |   33 ++++++++------------
 2 files changed, 15 insertions(+), 21 deletions(-)
---
diff --git a/LongoMatch/LongoMatch.mdp b/LongoMatch/LongoMatch.mdp
index 9994af9..0616564 100644
--- a/LongoMatch/LongoMatch.mdp
+++ b/LongoMatch/LongoMatch.mdp
@@ -196,10 +196,11 @@
     <File subtype="Code" buildaction="Compile" name="Store/TimeNode.cs" />
     <File subtype="Directory" buildaction="Compile" name="Time" />
     <File subtype="Code" buildaction="Compile" name="Store/Templates/CategoriesTemplate.cs" />
-    <File subtype="Code" buildaction="Compile" name="Store/Templates/TagsTemplate.cs" />
     <File subtype="Code" buildaction="Compile" name="Store/Templates/TeamTemplate.cs" />
     <File subtype="Code" buildaction="Compile" name="IO/XMLReader.cs" />
     <File subtype="Code" buildaction="Compile" name="Common/SerializableObject.cs" />
+    <File subtype="Code" buildaction="Compile" name="Store/SubCategory.cs" />
+    <File subtype="Code" buildaction="Compile" name="Store/Templates/SubCategoriesTemplates.cs" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
diff --git a/LongoMatch/Store/Templates/TagsTemplate.cs b/LongoMatch/Store/Templates/SubCategoriesTemplates.cs
similarity index 66%
rename from LongoMatch/Store/Templates/TagsTemplate.cs
rename to LongoMatch/Store/Templates/SubCategoriesTemplates.cs
index 149ca8e..90a659b 100644
--- a/LongoMatch/Store/Templates/TagsTemplate.cs
+++ b/LongoMatch/Store/Templates/SubCategoriesTemplates.cs
@@ -24,44 +24,37 @@ namespace LongoMatch.Store.Templates
 {
 
 	[Serializable]
-	public class TagsTemplate: SerializableObject
+	public class SubCategoriesTemplate: SerializableObject
 	{
-		List<Tag> tagsList;
-		public TagsTemplate()
+		List<SubCategory> subCategories;
+		
+		public SubCategoriesTemplate()
 		{
-			tagsList = new List<Tag>();
+			subCategories = new List<SubCategory>();
 		}
 
-		public bool AddTag(Tag tag) {			
-			if (tagsList.Contains(tag))
+		public bool AddSubcategory(SubCategory subCat) {
+			if (subCategories.Contains(subCat))
 				return false;
 			else
-				tagsList.Add(tag);
+				subCategories.Add(subCat);
 			return true;
 		}
 
-		public bool RemoveTag (Tag tag) {
-			return tagsList.Remove(tag);
-		}
-		
-		public Tag GetTag(int index){
-			return tagsList[index];
+		public bool RemoveSubCategory (SubCategory subCat) {
+			return subCategories.Remove(subCat);
 		}
 		
 		public int Count (){
-			return tagsList.Count;
-		}
-		
-		public IEnumerator<Tag> GetEnumerator(){
-			return tagsList.GetEnumerator();
+			return subCategories.Count;
 		}
 		
 		public void Save(string filePath){
 			Save(this, filePath);
 		}
 		
-		public static TagsTemplate Load(string filePath) {
-			return Load<TagsTemplate>(filePath);
+		public static SubCategoriesTemplate Load(string filePath) {
+			return Load<SubCategoriesTemplate>(filePath);
 		}
 	}
 }



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