Exemplo n.º 1
0
		Tag EnsureTag (TagInfo info, Category parent)
		{
			Tag tag = tag_store.GetTagByName (info.TagName);

			if (tag != null)
				return tag;

			tag = tag_store.CreateCategory (parent,
					info.TagName,
					false);

			if (info.HasIcon) {
				tag.ThemeIconName = info.IconName;
				tag_store.Commit(tag);
			}

			tags_created.Push (tag);
			return tag;
		}
Exemplo n.º 2
0
        bool TagNameExistsInCategory(string name, Category category)
        {
            foreach (Tag tag in category.Children) {
                if (String.Compare (tag.Name, name, true) == 0)
                    return true;

                if (tag is Category && TagNameExistsInCategory (name, tag as Category))
                    return true;
            }

            return false;
        }
Exemplo n.º 3
0
 void PopulateCategories(List<Tag> categories, Category parent)
 {
     foreach (Tag tag in parent.Children) {
         if (tag is Category && tag != this.tag && !this.tag.IsAncestorOf (tag)) {
             categories.Add (tag);
             PopulateCategories (categories, tag as Category);
         }
     }
 }
 public Category(Category category, uint id, string name)
     : base(category, id, name)
 {
     children = new List<Tag> ();
 }