Exemplo n.º 1
0
        public void Clear()
        {
            for (int i = 0; i < children.Count; i++)
            {
                ItemToolboxNode child = (ItemToolboxNode)children[i];
                child.SetParent(null);
                OnChildRemoved(child, i);
            }

            children.Clear();
        }
Exemplo n.º 2
0
        public void Remove(ItemToolboxNode child)
        {
            int pos = children.IndexOf(child);

            if (pos < 0)
            {
                throw new InvalidOperationException("A node cannot be removed if it is not in the store.");
            }

            children.Remove(child);
            child.SetParent(null);
            OnChildRemoved(child, pos);
        }
Exemplo n.º 3
0
        private void Build()
        {
            base.Clear();
            Hashtable categories = categorised? new Hashtable() : null;

            for (int i = 0; i < innerStore.Count; i++)
            {
                ItemToolboxNode node = (ItemToolboxNode)innerStore [i];
                node.SetParent(null);

                if (!node.Filter(filter))
                {
                    continue;
                }

                if (categorised)
                {
                    string cat = node.Category;
                    if (cat.Length < 1)
                    {
                        cat = "Miscellaneous";
                    }

                    if (!categories.ContainsKey(cat))
                    {
                        categories.Add(cat, new CategoryToolboxNode(cat));
                    }

                    ((CategoryToolboxNode)categories[cat]).Add(node);
                }
                else
                {
                    base.AddNode(node);
                }
            }

            if (categorised)
            {
                ArrayList arrList = new ArrayList(categories.Values);
                arrList.Sort(new SortByName());

                for (int i = 0; i < arrList.Count; i++)
                {
                    base.AddNode((CategoryToolboxNode)arrList [i]);
                }
            }
        }
Exemplo n.º 4
0
        public void Remove(ItemToolboxNode child)
        {
            int pos = children.IndexOf (child);

            if (pos < 0)
                throw new InvalidOperationException ("A node cannot be removed if it is not in the store.");

            children.Remove (child);
            child.SetParent (null);
            OnChildRemoved (child, pos);
        }
Exemplo n.º 5
0
 public void Add(ItemToolboxNode child)
 {
     child.SetParent (this);
     children.Add (child);
     OnChildAdded (child);
 }
Exemplo n.º 6
0
 public void Add(ItemToolboxNode child)
 {
     child.SetParent(this);
     children.Add(child);
     OnChildAdded(child);
 }