private int CreateTagPriv (Category parent_tag, string name) { try { Tag created = tag_store.CreateCategory (parent_tag, name); return (int)created.Id; } catch { throw new DBusException ("Failed to create tag."); } }
public Category(Category category, uint id, string name) : base(category, id, name) { children = new List<Tag> (); }
void LoadCategory (Category category, TreeIter parent_iter) { foreach (var t in category.Children) { var iter = model.AppendValues (parent_iter, t.Id, t.Name); if (t is Category) LoadCategory (t as Category, iter); } }
// Loading up the store. private void LoadCategory(Category category, TreeIter parent_iter) { IList<Tag> tags = category.Children; foreach (Tag t in tags) { TreeIter iter = (Model as TreeStore).AppendValues (parent_iter, t.Id, t.Name); if (t is Category) LoadCategory (t as Category, iter); } }
// You are not supposed to invoke these constructors outside of the TagStore class. public Tag (Category category, uint id, string name) : base (id) { Category = category; Name = name; }
public Category (Category category, uint id, string name) : base (category, id, name) { children = new ArrayList (); }